Hi
I am use this scriptrunner to perform when a sub-task is going to "in progress", the issuetype story take the same workflow status.
But I have the following error:
"The script could not be compiled: <pre>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script625.groovy: 1: unable to resolve class com.atlassian.jira.ComponentManager @ line 1, column 1. import com.atlassian.jira.ComponentManager; ^ 1 error </pre>."
There is the code.
import com.atlassian.jira.ComponentManager;
import com.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;
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 isToDoStatus = originalParentStatus in ['To Do']
if (isToDoStatus) {
workflowTransitionUtil.setIssue(parent)
workflowTransitionUtil.setUserkey(currentUser)
workflowTransitionUtil.setAction(31)
if (workflowTransitionUtil.validate()) {
workflowTransitionUtil.progress()
}
}
Can anyone help me?
I believe you are on Jira 8x version
You've imported ComponentManager in your 1st line of script. this class is being deprecated in Jira's 8x versions
Also I don't think you use that class in your script. so just removing the 1st import line would fix your issue
You can refer this page for more details: https://scriptrunner.adaptavist.com/5.4.49-jira8/jira/releases/UpgradingToJira8.html
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.