Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by n

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();
}


}

 

2 answers

Have you fixed it ?

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 03, 2021

+1 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events