Quantcast
Channel: Active questions tagged atlassian-plugin-sdk - Stack Overflow
Viewing all articles
Browse latest Browse all 279

Caused by: org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction

$
0
0

I am trying to execute a transition when clicking on a menu item in Jira Data Center. I have tried the following code. It is using the APIs workflowTransitionUtil.setAction, workflowTransitionUtil.validate and workflowTransitionUtil.progress and it also fails. I am creating a custom post function for a transition. I am getting the errror:

Caused by: org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.com.atlassian.jira.transaction.TransactionRuntimeException: org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.2022-08-17 11:31:55,313+0200 https-openssl-nio-443-exec-533 ERROR mouh 691x78439x26 1a2i7f4 10.248.140.0 /secure/CommentAssignIssue.jspa [c.a.jira.transaction.TransactionSupportImpl] Unable to commit transaction : Commit failed, rollback previously requested by nested transaction.

Could you please let me know about the solution? My transition is leading to itself and I would like to execute it even though it is leading to itself.

import com.atlassian.jira.workflow.WorkflowTransitionUtilimport com.atlassian.jira.issue.comments.Commentimport com.atlassian.jira.workflow.JiraWorkflowimport com.atlassian.jira.workflow.WorkflowManagerimport org.apache.log4j.Loggerimport com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.workflow.WorkflowTransitionUtilImplimport com.atlassian.jira.util.JiraUtilsimport com.atlassian.jira.user.ApplicationUser;def log = Logger.getLogger("atlassian-jira.log")log.warn("test")WorkflowManager workflowManager = ComponentAccessor.getWorkflowManager();JiraWorkflow workflow = workflowManager.getWorkflow(issue);def wfd = workflow.getDescriptor()def actionName = wfd.getAction(transientVars["actionId"] as int).getName(); ApplicationUser mycurrentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()log.warn("This is the last action done "+actionName)log.warn("CAM 2")int transitionToBeDoneInt = 1731 //ID of MounaTransitionlog.warn("cam 3 " +transitionToBeDoneInt)def myComment= "+++ added via workflow action "+actionName+"\"+++"log.warn("cam 4 "+actionName)def content =( transientVars["comment"] +"\n"+myComment )as Stringlog.warn("cam 5 "+ content)transientVars["comment"]= contentlog.warn("cam 6"+ content)log.warn("CAM 7 "+ issue.getKey())def inputParameters = ComponentAccessor.getIssueService().newIssueInputParameters();log.warn("CAM 8 "+" "+issue.getId()+" "+ transitionToBeDoneInt+" "+inputParameters)def workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class )workflowTransitionUtil.setIssue(issue)workflowTransitionUtil.setUserkey(mycurrentUser.getKey())workflowTransitionUtil.setAction(transitionToBeDoneInt);//Id of the status you want to transition tolog.warn("CAM 9 "+" "+issue.getId()+" "+ transitionToBeDoneInt+" "+inputParameters)workflowTransitionUtil.validate()log.warn("CAM 19 "+" "+issue.getId()+" "+ transitionToBeDoneInt+" "+inputParameters)workflowTransitionUtil.progress();log.warn("CAM 11 "+" "+issue.getId()+" "+ transitionToBeDoneInt+" "+inputParameters)

Viewing all articles
Browse latest Browse all 279

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>