Hello @Raj_253,
You can use any plug-in's functionality to write a script for this to work. Different plug-ins like Scriptrunner/ JMWE/ cPrime Power Scripts, etc., offer this functionality. Based on the available plug-in in your Jira instance, you can take a look at the corresponding plug-in's documentation to pull the script.
Hope this helps!
Thanks!
import com.atlassian.jira.ComponentManager;
importcom.atlassian.jira.issue.comments.CommentManager;
import com.opensymphony.workflow.WorkflowContext;
import org.apache.log4j.Category;
import com.atlassian.jira.config.SubTaskManager;
import com.atlassian.jira.workflow.WorkflowTransitionUtil;
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;
import com.atlassian.jira.util.JiraUtils;
import com.atlassian.jira.issue.MutableIssue;
log =Category.getInstance(“com.onresolve.jira.groovy.AutoCloseChildIssues”);String currentUser =((WorkflowContext) transientVars.get(“context”)).getCaller();WorkflowTransitionUtil workflowTransitionUtil =(WorkflowTransitionUtil)JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class);MutableIssue parent = issue.getParentObject();SubTaskManager subTaskManager =ComponentManager.getInstance().getSubTaskManager();Collection subTasks = parent.getSubTaskObjects();if(subTaskManager.subTasksEnabled){boolean transitionParent =true;for(subtask in subTasks){String status = subtask.getStatusObject().getSimpleStatus().getName();if(status !=”Resolved”&& status !=”Testing”&& status !=”Waiting For Approval”&& status !=”Closed”&& status !=”Approved”){
transitionParent =false;}}if(transitionParent){
workflowTransitionUtil.setIssue(parent);
workflowTransitionUtil.setUserkey(currentUser);
workflowTransitionUtil.setAction(5);
workflowTransitionUtil.validate();
workflowTransitionUtil.progress();}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.