Since the original poster of Script Runner Transition parent issue based on subtask status didn't share his script I have to ask the question again.
I would like to automatically transition a parent issue from the status "Backlog Dev" to "Implementation", if one if its subtasks is transitioned to "Implementation". I started of with the script posted at www.petervandevoorde.com/2014/09/18/automatically-transition-a-parent-issue-from-a-subtask-in-jira/ and modified it a little bit. Since
MutableIssue parent = issue.getParentObject();
shows an error, I changed it to
MutableIssue parent = issue.getParentObject() as MutableIssue
The whole script looks like this:
import com.opensymphony.workflow.WorkflowContext;
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;
import com.atlassian.jira.component.ComponentAccessor
String currentUser = ((WorkflowContext) transientVars.get("context")).getCaller()
WorkflowTransitionUtil workflowTransitionUtil = (WorkflowTransitionUtil) JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class)
MutableIssue parent = issue.getParentObject() as MutableIssue
String originalParentStatus = parent.getStatus().getSimpleStatus().getName()
def isDevBacklogStatus = originalParentStatus in ['Next Up Dev', 'Backlog Dev', 'Selected for Development']
if (isDevBacklogStatus) {
WorkflowTransitionUtil.setIssue(parent)
workflowTransitionUtil.setUserkey(currentUser)
workflowTransitionUtil.setAction(171)
if (workflowTransitionUtil.validate()) {
workflowTransitionUtil.progress()
}
}Now the script doesn't show any errors in the edit field, but when triggering the script i get the following error:
2016-02-26 23:28:28,062 ERROR [workflow.ScriptWorkflowFunction]: *************************************************************************************
2016-02-26 23:28:28,093 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: KDEVA-42, actionId: 171, file: <inline script="">
groovy.lang.MissingMethodException: No signature of method: static com.atlassian.jira.workflow.WorkflowTransitionUtil.setIssue() is applicable for argument types: (com.atlassian.jira.issue.IssueImpl) values: [KDEVA-24]
at Script944.run(Script944.groovy:17)
I'm still new to Groovy, so I can't figure out what I need to change to gt it to work. Can someone help, please?