Assistance with Scriptrunner infinite loops

Andrew Zajicek
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2025

Greetings,

I am working on creating some scriptrunner automation within jira and am having trouble. I need to trigger the creation of multiple Issues during the Epic transition to “Open" using a "post function", and I've been using the "Clone Issue" function. I figured I could just create multiple "clone issue" functions to create all the issues I need, but for some reason even before setting up more than one, this single function loops infinitely creating an endless number of issues when it should only be doing it once.

Any idea where it is going wrong and creating the loop, or is there a better way to be going about doing this in the first place?

Here is how I have it set up currently:

2025-02-06 16_44_19-Add Workflow Transition Function - Jira.png2025-02-06 16_44_57-Add Workflow Transition Function - Jira.png2025-02-06 16_45_34-Add Workflow Transition Function - Jira.png

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Luka Hummel - codefortynine
Atlassian Partner
February 7, 2025

Hi @Andrew Zajicek and welcome to the community!

If you're open to an alternative solution, I highly recommend Deep Clone for Jira. With Deep Clone, you can configure Post Function Clones that avoid looping issues by offering detailed control over the cloning process. You can:

  • Add conditions to the transition to ensure the clone action triggers only once.
  • Clone multiple issues at once without running into the recursive problems you're experiencing.

2025-02-07 11-32.png

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2025

Hi Andrew,

In order to diagnose what is causing the loop, I would advise raising a support ticket here so that the ScriptRunner Support team can investigate what is causing the loop issue you are seeing.

As for creating issues, I would advise creating a run script post function and then using HAPI which is the Helpful API that has just been released for ScriptRunner.

Using Hapi you will be able to create issues and set field values on them using a natural language syntax and you can see an example of creating issues in the documentation page located here.

I hope this information helps.

Regards,

Kristian

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events