Scriptrunner postfunction silent fail

Jakub Cieplinski December 16, 2021

I'm looking to migrate from JSS Pro to scriptrunner and recreating our scripts functionality.

In jython, when something failed, and for example exception was raised in workflow transition post function the workflow failed to transition and we got this screen or similar. Which is desirable behaviorScreenshot_25.png

 

Scriptrunner post functions however, just silently fail, allow the transition to happen and just leaves log in atlassian-jira.log

2021-12-16 11:28:41,581+0000 http-nio-8080-exec-15 ERROR user 688x6423x1 1pnrhxj 172.18.0.1 /secure/WorkflowUIDispatcher.jspa [c.o.s.jira.workflow.AbstractScriptWorkflowFunction] Workflow script has failed on issue XXX-2485 for user 'user'. View here: http://localhost:8081/secure/admin/workflows/ViewWorkflowTransition.jspa?workflowMode=live&workflowName=XXX%3A+Defect%2FTask&descriptorTab=postfunctions&workflowTransition=181&highlight=1

com.opensymphony.workflow.WorkflowException: testFailure

at testClass.run(testClass.groovy:20)

And I don't like this behavior, I would like to recreate the one provided by JSS, is there some special type of exception I have to throw?

1 answer

0 votes
Jakub Cieplinski December 16, 2021

I have found that I would need to basically try to catch any exceptions and do

assert false

 but it's still not something I'm entirely happy with. Is there a better way?

Suggest an answer

Log in or Sign up to answer