You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.