JIRA Automation rule

Naveen kumar Bhoomanagari _HCL_ February 22, 2024

We have JIRA automation rule which would that clones all the stories under a given Epic. I’ve noticed, however, that when the clone occurs it’ll put the newly cloned stories in a random order under the new epic.

I’d like to ask if its possible to add a new step or something to my Action that’ll cause the stories to be cloned over in the same order they are originally listed in the original Epic.

So if I have 4 stories under an Epic, and they are listed as A,B,C,D I’d like them to be cloned over in that same order. Currently it’d clone them over randomly like C,B,D,A.

1 answer

1 vote
Bill Sheboy
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.
February 22, 2024

Hi @Naveen kumar Bhoomanagari _HCL_ -- Welcome to the Atlassian Community!

The short answer is: no, that is not possible with an automation rule for an unknown number of issues to be cloned.

The longer answer is...

Automation rule branches which could be on more than one thing (e.g., on JQL, linked issues, etc.) are run in parallel and asynchronously.  In fact, there is no guarantee of when the branch will complete...up until the last step of the rule!

Thus when using a branch to iterate over the child issues in the epic, there is no way to enforce the order of creation (or ranking).

If you truly need this ordering, two possible options are:

  • When there are only a few, known number of issues, they can be created one-by-one.  To perform this technique, this pattern could be used:
    • action: use Lookup Issues with JQL to find the issues to be cloned
    • action: create issue, setting the fields using the lookup results.  The list index is zero-based, and so the first one is 0
      • {{lookupIssues.get(0).summary}}
      • {{lookupIssues.get(0).description}}
      • etc.
    • action: create issue, setting the fields using the lookup results for the second issue
      • {{lookupIssues.get(1).summary}}
      • {{lookupIssues.get(1).description}}
      • etc.
    • ...repeat for subsequent issues
  • Use a marketplace addon for issue cloning capable of preserving the issue order

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events