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

srinivas kattla March 12, 2020

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

1 vote
Shradha Singh April 13, 2020

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.
July 3, 2021

+1 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events