Hi All,
I'm getting this error below error for the script that I'm working on issue in log but pop with error when I try to do the transition of epic .
The listed script perform transition the child issues of epic when epic transition changes.
org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.
It seems that you have tried to perform an illegal workflow operation.
If you think this message is wrong, please contact your Jira administrators.
...........................................................................................................................
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.atlassian.greenhopper.manager.issuelink.EpicLinkManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.workflow.WorkflowTransitionUtil;
//import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;
import com.atlassian.jira.util.JiraUtils;
import com.atlassian.jira.workflow.WorkflowTransitionUtil;
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;
import com.atlassian.jira.issue.MutableIssue;
import com.opensymphony.workflow.WorkflowContext;
@WithPlugin("com.pyxis.greenhopper.jira")
@JiraAgileBean
EpicLinkManager epicLinkManager
def epic = issue
//def issue = ComponentAccessor.issueManager.getIssueObject('PD-5700')
//get the epic link field
def customFieldManager = ComponentAccessor.customFieldManager
def epicLinkCf = customFieldManager.getCustomFieldObjects(issue).find{it.name == 'Epic Link'}
//get the epic from the current issue
//def epic = issue.getCustomFieldValue(epicLinkCf) as Issue
def issuesInEpic = epicLinkManager.getIssuesInEpic(epic)
issuesInEpic.each { issueInEpic ->
//do something on each issues in the epic
WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class );
int transitionId = 0;
workflowTransitionUtil.setUserkey("ds.pmo")
String issueTypeName= issueInEpic.getIssueType().getName();
if(issueTypeName.equalsIgnoreCase("Defect")){
transitionId = 501;
} else if(issueTypeName.equalsIgnoreCase("Task")){
transitionId =91;
}
if(transitionId!=0) {
workflowTransitionUtil.setIssue((MutableIssue)issueInEpic);
//workflowTransitionUtil.setIssue(issue);
workflowTransitionUtil.setAction(transitionId);
workflowTransitionUtil.progress();
}
}
+1
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.