Jira hangs in a post function script (script runner)

Hi, in a workflow transition i have two script post functions (script runner). The first one creates a new project, the second one creates an issue for that project.

but Jira stops working when creating the issue, I see no errors in the log, and when I execute the code in script console it works fine creating the project and its issue.

But in the transition jira stops working in the issueService.create sentence.

The log does not shows any error, but i have to stop jira and start it again. When I remove the post function that creates the issue, jira creates the project just fine and viceversa.

It seems to me that this is a lock problem or something like that. Can Anyone help me.

IssueService issueService = ComponentAccessor.getIssueService();


if (result.getErrorCollection().hasAnyErrors()) {



issueService.create(asignado, result); (Here is where Jira hangs)

3 answers

1 accepted

0 votes
Accepted answer

Hi, lost so much time trying to fix this problem by myself that at the end I had to find a quick solution, so what I did was that I left the script that creates a project in the transition and removed the post function that creates the issue.

Then I added another script post function at the end that does a fast-track transition (new transition) in which I added the script post function that creates de issue for the project.

The new transition starts and ends in the same step, it is only used to execute the script post function.

So I guess the problem has to do with the Database, as long as the transition doesn’t end the project is not really inserted (or needs a commit) and the issue can’t be added because of that.


When it's "locked", get a thread dump, using jstack or whatever. Post that, maybe we can work out what the problem is.

You can create a project in a transition using this script: https://gist.github.com/jechlin/7198215

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,717 views 3 11
Read article

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