Hello everyone,
I would like to change the state of an issue when a sub-task go through its "In progress" state to "Done". One important point is that the issues belong to a workflow while all sub-task belong to a different one.
After some search on the community I tried with this code:
import com.opensymphony.workflow.WorkflowContext;
import com.atlassian.jira.workflow.WorkflowTransitionUtil;
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;
import com.atlassian.jira.util.JiraUtils;
import com.atlassian.jira.issue.MutableIssue;
WorkflowTransitionUtil workflowTransitionUtil = (WorkflowTransitionUtil) JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class)
MutableIssue parent = issue.getParentObject() as MutableIssue
workflowTransitionUtil.setIssue(parent)
workflowTransitionUtil.setAction(241)
if (workflowTransitionUtil.validate()) {
workflowTransitionUtil.progress()
}
that return a simple message error like this
ERROR [workflow.AbstractScriptWorkflowFunction]: Script function failed on issue: NSJ-15, actionId: 161, file: null
Anyone can help me?
Thanks