Groovy "Script Post Function" not executing

I'm attempting to run the attached js script as a post function between two workflow steps. Upon execution, the post function seemingly does not execute and the system behaves exactly as it did before I added this new post function. I'm unsure where the error log might exist for JIRA so instead I'll step you through some of my troubleshooting techniques to date:

  • Gave the post function a bogus file path. It didn't so much as error out saying no such file.
  • Ran the script on the "script fields" tab for groovy. I provided the script in the "script file path" to verify that the script was being found on the server. The script worked like a charm.
  • Ran the script on script runner but it threw an error which I've attached.

(lockedestimate.js.txt) (stacktrace.txt)

3 answers

1 accepted

1 vote

That's not javascript (js), that's groovy, as such it needs to have the extension .groovy.

The exception shows you that the wrong interpreter is being invoked:

If you have applied the updated workflow with the script post-function, there will be an exception in the logs.

worked like a charm. it's always the simple things that end up consuming far too much time. ;)

i am facing same prob. Script is not getting executed. And i am not sure where to put the script so that JIRA locates the path.

I think this is a different problem, please ask a new question.


Could you confirm that you have checked the notes from Jamie here?

Consider it confirmed. I decided it use an absolute path since $CATALINA_BASE looked not to be set. That path is D:\JIRA\work\Catalina\lockedestimate.js where D:\JIRA is the path for our JIRA install.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

246 views 1 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you