Jira hangs in a post function script (script runner)

Gustavo Oviedo October 16, 2013

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()) {

log.error(result.getErrorCollection())

}

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

3 answers

1 accepted

0 votes
Answer accepted
Gustavo Oviedo October 18, 2013

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.

Thanks

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2013

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

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events