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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

0 votes

+1 

Have you fixed it ?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

166 views 2 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you