Groovy Script to create child issues from a checklist

David Lepaux Lepaux
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!
November 13, 2023

Hi Community !

I'm developing a Groovy Script on a transition on a workflow. During the transition, I show a screen where the user can select some elements from a checklist (custom field). All of this to create child issues automatically.

Expected behaviour

I expect the script to create child issues and then in the parent to see them sorted in order of creation.

Actual behaviour

When I do the transition the script is ran successfully and issues created in the right order (I can see that with the KEY) but they are shown randomly, even not by name or something.

There is also something strange happening, when I test the script against an issue wihtin the editor it works fine, but in production like, it's chaotic. Like shown in the screenshot below:

Tickets enfants.png

You can find the script here: https://github.com/dlepaux/groovy/blob/main/script.groovy

I believe the script is well documented by comments but if you have any question let me know.

 

1 answer

0 votes
Dom
Contributor
December 27, 2023

Yes, it's Chaotic. :(

As is such with so many things at Atlassian, the simplest and most obvious features languish on the back-log for decades. These are from 2009!
https://jira.atlassian.com/browse/JRASERVER-16281
https://jira.atlassian.com/browse/JRACLOUD-16281

More detail on a similar question can be found here:
https://community.atlassian.com/t5/Jira-Service-Management/Sorting-Order-of-linked-issues/qaq-p/2136683

Good Luck!

Suggest an answer

Log in or Sign up to answer