Automation Help

Jacob Hanson
Contributor
February 1, 2024

Hey Team, 
I am having some troubles making an automations. 
#1 - I want to make a button (manual trigger) to clone an issue type 'task' and all of its sub issues / child items. Can someone help with steps, currently mine is only cloning parent. 

Thanks, 

 

 

2 answers

2 accepted

3 votes
Answer accepted
Rudy Holtkamp
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 2, 2024

Hi @Jacob Hanson ,

I've elaborated the two options below. One is with the Deep Clone app and a post function, the other is based on Automation for Jira.

Deep Clone post function

Take a look at the gif below. I've mad a step-by-step instruction. 

deepclone-postfunction.gif

  • First you need to open the workflow e.g. of the epic.
  • Then you create a transition from any to itself
  • Add a post function on this transition, choose the Deep clone Epic/tree post function
  • Fill in the required options. I mostly want to create it in the same project and keep all issuetypes the same
  • Save the workflow
  • And then you can use it. The button will show up in the action menu.
    Note that it will take some time to clone the issue tree.

Clone tree with Automation for Jira

You don't need an app for this. But you need to create two rule.

Rule 1

Use a manual trigger and 'Prompt for input when this rule is triggered'. Call it Prefix with a Default value 'Clone - ' (without the quotes) and a var name prefix.

Clone the issue/create issue and copy every field from current issue that is needed, use this as summary:{{userInputs.prefix}}{{issue.summary}}

Then add a send web request action use as web request URL the one you will create in rule 2. Append ?issue={{createdissue}} to this URL.
Use Post as method and add this custom date: 

{
"prefix":"{{triggerissue.prefix}}",
"clonekey":"{{issue.key}}"
}
Check Delay execution of subsequent rule.

image.png

Rule 2

Use as trigger an incoming webhook, copy the URL and use that in rule 1, don't forget to append the string mentioned earlier. It should look like this:
https://automation.atlassian.com/pro/hooks/8dda01c81a2ef4cf53c4ab0b008b3d2df281c68d?issue={{createdissue}}

Add a branch for JQL / related issue. Use JQL: parent = {{webhookData.clonekey}}

In the branch create issue. Copy every field from current issue that you need. Use as summary: {{webhookData.prefix}}{{issue.summary}} and add Parent field with Trigger issue as content.

Add a send webrequest which need to be exactly the same as in rule 1

image.png

 

The button to trigger this will appear in the action menu of an issue. This will create a clone of the parent. The rule will also trigger the second rule which will create the children of the first rule, but will also create all issues further down the hierarchy. It is up to you to decide which fields need to be cloned.

 

Good luck!

Jacob Hanson
Contributor
February 2, 2024

Your a wizard, 
Thank you for your help

Like Rudy Holtkamp likes this
Luka Hummel - codefortynine
Atlassian Partner
February 5, 2024

Hi @Rudy Holtkamp thank you for providing a great guide for using our new Epic/Tree Post Function 😊

@Jacob Hanson Let me know if you have any questions regarding using Deep Clone. You can find also more information in our documentation.

Like Jacob Hanson likes this
1 vote
Answer accepted
Rudy Holtkamp
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 1, 2024

Hi @Jacob Hanson 

The easiest way is to install Deep Clone.

Since you are on a free plan (10 users or less), the app is also free.

But if you want to do it yourself using Automation for Jira, you can make the following rule, to clone Epics and the children.

image.pngimage.png

The idea is:

1. Create the clone of the parent

2. Branch to all it's children

3. Create a clone of each child, using the clone parent key in the Parent field.

 

The shown automation is only for two levels deep clones. If you want to add sub-tasks, it is a bit harder. Which is not explained in a few minutes.

 

Jacob Hanson
Contributor
February 1, 2024

Thanks a ton, I will look into both options and go from there. 
Appreciate your in depth help. 

Like Rudy Holtkamp likes this
Jacob Hanson
Contributor
February 1, 2024

@Rudy Holtkamp 
Deep clone is perfect for an administrator, however I am trying to make a user friendly button to clone it all, is there a way to put deep clone into a workflow or do I need to make the branch workflow? 

I have 2 templates with 10 plus child issues that will regularly need to be cloned. I need something faster, any ideas? 

Rudy Holtkamp
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 1, 2024

I will reply tomorrow.

Suggest an answer

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

Atlassian Community Events