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

Freeze subtasks groovy script does not work on JIRA 8

I have this Script:

 

subTasks.each {

SubtaskKey = it.key
SubtaskStatus = it.getStatus().getName()
log.info "Script=" + scriptName + " IssueKey=" + IssueKey + " ScriptRunIdent=" + scriptRunIdent + " Action='Processing " + SubtaskKey + "' Status=" + SubtaskStatus

if (SubtaskStatus == "Open")
{
//Set Freeze Date from Parent
it.setCustomFieldValue(FrozenUntil,FrozenUntilValue)
// Transist Issue
workflowTransitionUtil.setIssue(it)
workflowTransitionUtil.setAction (921) // 921 = Freeze
//validate and transition issue
workflowTransitionUtil.validate()
workflowTransitionUtil.progress()
}

if (SubtaskStatus == "In Progress")
{
//Set Freeze Date from Parent
it.setCustomFieldValue(FrozenUntil,FrozenUntilValue)
// Transist Issue
workflowTransitionUtil.setIssue(it)
workflowTransitionUtil.setAction (791) // 791 = Freeze
//validate and transition issue
workflowTransitionUtil.validate()
workflowTransitionUtil.progress()
}
}

 

That worked fine on JIRA 7.x 

On JIRA 8 I get:

 

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

 

In the logs:

2019-12-17 13:09:12,537 http-nio-6060-exec-86 ERROR npn 789x11830326x1 mece4z 77.243.59.220,77.243.49.62 /secure/CommentAssignIssue.jspa [c.a.jira.workflow.OSWorkflowManager] Caught exception while attempting to perform action 931 from workflow 471131 on issue 'NIS-65999'
com.atlassian.jira.transaction.TransactionRuntimeException: org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.
at com.atlassian.jira.transaction.TransactionSupportImpl$TransactionImpl.commit(TransactionSupportImpl.java:91)
at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:849)
at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:799)
at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:514)
at com.atlassian.jira.web.action.issue.CommentAssignIssue.doExecute(CommentAssignIssue.java:161)
... 1 filtered
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
... 7 filtered
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
... 48 filtered
at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:62)
... 7 filtered
at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:37)
... 4 filtered
at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
... 3 filtered
at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55)
... 8 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
... 51 filtered

 

For all Sub-task issues...

Do I need som store/reindex/commit stuff...

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,534 views 22 32
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