Hello Kyle,
you could specify the following script into your transition:
import java.util.Collection; import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.issue.Issue; import com.atlassian.jira.issue.MutableIssue; import com.atlassian.jira.issue.status.Status; import com.atlassian.jira.workflow.JiraWorkflow; import com.atlassian.jira.workflow.WorkflowManager; WorkflowManager workflowManager = ComponentAccessor.getWorkflowManager(); Issue issue = issue; Collection<Issue> subtasks = issue.getSubTaskObjects(); for(Issue sub : subtasks){ JiraWorkflow workflow = workflowManager.getWorkflow(sub); Collection<Status> statuses = workflow.getLinkedStatusObjects(); Status destStatus = null; for(Status status : statuses){ if(status.getName().equalsIgnoreCase("YOUR FINAL STATUS HERE")){ destStatus = status; break; } } workflowManager.migrateIssueToWorkflow((MutableIssue)sub, workflow, destStatus); }
Please, specify your final status first.
Hope this helps,
Fabio
I did some changes on the provided script and it works well. thanks so much Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.