Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation to clone all the child issues and let the user define parent for the cloned issues

Łukasz Parafiniuk January 17, 2025

Hello,

I am struggling all day to find a way to create such an automation: 

I would like to make it possible for users to manually trigger an automation from epic and to clone all the child issues of this epic. That is pretty simple but what I also want to achieve is to enable users to somehow be able to define the parent epic for the cloned issues. 

I've tried an approach with defining a new linktype and storing the info about the desired epic there but couldn't reach it in automation to make it fill the parent field in cloned issues. 

Now I'm trying to do something simplier. I just made it possible for users to provide the key to the desired epic when triggering the automation. The field is short text type. I store it as a userinput smartvalue and then try to use it in a branch rule for all the children which doesn't seem to work. 

Work in my organisation is pretty repeateable so making this functionality would be a great help for the team leads. 

How my automation looks right now and what the audit log looks like is shown on the screenshots. 

Thanks for all the help in advance! 


2 answers

0 votes
Luka Hummel - codefortynine
Atlassian Partner
January 20, 2025

Hi @Łukasz Parafiniuk and welcome to the community!

If you're looking to streamline the process of cloning child issues and assigning them to a new parent epic, I highly recommend checking out our app Deep Clone for Jira.

With Deep Clone, you can:

  • Epic/Tree Clone: Clone entire issue hierarchies, including all child issues, with just a few clicks.
  • Field Editor: Easily set the parent epic for the cloned child issues during the cloning process.
  • Configure cloning behavior to preserve links, custom fields, comments, and attachments.
0 votes
Dick
Community Champion
January 17, 2025

Hi @Łukasz Parafiniuk Welcome to the Atlassian Community.

Please share pictures of your automation, including pictures of settings inside the step where you use the user input to find a corresponding epic issue. This gives us the information on how to help you with your problem.

Kind regards,

Dick

Łukasz Parafiniuk January 17, 2025

My apologies. I was sure I added them while creating the question. 

There You go @Dick :) 

image.pngimage.pngimage.png

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.
January 17, 2025

Hi @Łukasz Parafiniuk -- Welcome to the Atlassian Community!

Adding to the suggestions from @Dick ...

Please also post an image of the audit log details showing the rule execution.

And, I recommend changing the name of the variable in the Manual trigger from "parent" to "varParent" (and also in the Clone Issue action).  Using a variable with the same name as an issue field is risky as it could lead to mistakes / errors in rules.

Kind regards,
Bill

Like # people like this
Łukasz Parafiniuk January 18, 2025

@Bill Sheboy I've seen some of your comments on other threads when I was looking for a solution to this problem and I must say I absolutely love your work here! 

I just changed the variable's name to varParent and it worked :) Thank you so much! 


Maybe You will be able to help me solve my first idea for this automation. Is it possible to make it rely on a link within the epic issue? 

I have made a new link called "Target issue" so looking from the epic perspective the "new parent" for cloned issue will be linked by "Is the target" link. I would like the automation to get this new epic key and use it to put into parent field within the cloned issues.

My reasoning is that although it may seem more complicated than just putting the new parent by the user manually, it makes it possible for the user to find the epic on the list insted of just typing in as a free text. 

2025-01-18 13_45_42-View Issue Link Types - JIRA.png

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.
January 18, 2025

Yes, that is likely possible in two ways.  I recommend the first approach using Lookup Issues as it is easier to test, although the rule is slightly slower rule to process.

  • Using Lookup Issues
    • Before the branch, use the Lookup Issues action with JQL to find the correct issue based on the linking to the trigger issue
    • Use a smart values condition to confirm only one issue was returned
      • first value: {{lookupIssues.size}}
      • condition: equals
      • second value: 1
    • Use that one issue as the new parent when cloning
      • {{lookupIssues.first.key}}
  • Using smart value, list filtering of the issuelinks
    • Assuming the trigger issue has the link, that might be this
      • {{#triggerIssue.issuelinks}}{{#if(equals(type.outward, "Is the target"))}}{{outwardIssue.key}}{{/}}{{/}}
    • This can be challenging to get correct due to link direction, and so I recommend testing with test issues and writing values to the audit log to avoid causing problems

 

Like Dick likes this

Suggest an answer

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

Atlassian Community Events