Task Statuses Automation when Cloned

Heather Hanselmann
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!
December 2, 2024

I have created the proper automation to clone an epic in Jira however when the Epic, all of the tasks, and subtasks are cloned it is placing all of the tasks into the same status instead of cloning them and keeping the existing status they are in when cloned. How do I create an automation to not only perform the cloning but to also clone each task and subtask and keep the current status it is in? This is the template I created to clone the epic from. Each task and subtask need to stay in their respective phase when cloned. I work in events and we do not use statuses in the same way as other areas of the business so the typical use cases for other teams in Jira do not apply to us. Thanks for your help!Jira Template Screenshot.JPG

2 answers

0 votes
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.
December 2, 2024

Hi @Heather Hanselmann -- Welcome to the Atlassian Community!

Short answer: you will need another rule for that, or to create the issues using the REST API and the Send Web Request action.

 

By default, when an issue is cloned it sets to the initial status in the workflow.  And changing the status is different from other fields as it performs a transition, using that workflow to guide any additional checks, actions, etc.

Issues can be created with a different status, but the built-in Issue Create and Issue Clone actions do not apparently support that extra parameter needed.

Two workarounds are:

  • Two rule approach (This one would be the least amount of change for your current approach.)
    • When you clone the issue, save the desired target status in a custom field or entity property
    • Create a second rule, triggered on Issue Create, enabling the option "Check to allow other rule actions to trigger this rule..."  This second rule will perform the transition and clear the custom field / entity property.
  • One rule, REST API approach
    • Rather than using the built-in Clone Issue action, call the REST API to create the issue with the Send Web Request action
    • There is no endpoint to clone an issue, and so each field which needs to be copied needs to be included, although there are limitations to this approach as multiple REST API calls may be needed to create a single issue

Kind regards,
Bill

Heather Hanselmann
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!
December 2, 2024

Thank you for your answer @Bill Sheboy. I am a novice at Jira automation so I appreciate your patience. A few questions:

  • For the two rule approach I have the desired status as a custom field already. Where do I save this in the automation to keep the custom field the same status when cloned?
  • For the second rule, my assumption is that this rule will be created on it's own as an independent rule not a rule inside the clone rules I've already created?

Thank you for your help!  

Heather Hanselmann
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!
December 2, 2024

@Bill Sheboy I tried what I think you meant for the two rule approach above. It did not work so I am assuming I am doing something wrong. See attached photos of the rule I created. Jira Status Assignment Rule Screenshot.JPGJira Status Assignment Phase Condition Screenshot.JPGJira Status Assignment Branch Screenshot.JPGJira Status Assignment Transition Screenshot.JPG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hello Heather,

When you say the rule didn't work, it is helpful if you tell us exactly what it did and did not do.

You don't need the Branch at all.

You do need to use an If/Else block. When you use a series of IF conditions the rule stops running when if encounters the first IF condition that fails.

Screenshot 2024-12-02 at 12.52.33 PM.png

With an IF/ELSE block you instruct the rule as follows:

If A is true, then do this step

Else if B is true, then do this other step

Else if C is true, then do a different step

After selecting the IF/ELSE option your rule looks like this:

Screenshot 2024-12-02 at 12.54.45 PM.png

You would add your first condition on the right where it says Add conditions. On the left you would click on Add component to add the Transition Issue action that goes with that condition.

Then on the left you would click on Add else to add the next condition and companion Transition Issue action.

Screenshot 2024-12-02 at 12.58.51 PM.png

Repeat that for each condition/transition pair.

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hello @Heather Hanselmann 

Welcome to the Atlassian community.

Do I understand correctly that you already have a rule that is properly cloning all the issues? Can you please provide screen images that show the entire rule?

What is your scenario for Statuses? Do your work items more from one status to another, or do they stay in the one status assigned to them forever?

You will, basically, need to add the Transition Issue action to change the status of each issue after it has been created. This will require that the workflow for the issues supports a direct transition from the initial Status to the desired Status without any Conditions, Validators or Transition Screens. The exact changes that will be needed depend on the current structure of your rule. You can either add the step to the existing rule, or you can create another rule triggered by Issue Creation to execute the transition.

Heather Hanselmann
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!
December 2, 2024

Hi @Trudy Claspill!

 

 Our tasks and sub-tasks stay in the same status until completed. We do not move them from one status to another. So to answer your first question yes we already have a rule that is correctly cloning the epic with all tasks and subtasks. Additionally, when I clone the Epic there is a section in the automation that will ask me for the new name of the Epic. When I fill in the name and select for the template to be cloned it does not change the name to the new name I entered and it adds the word CLONE to the Epic title. It also adds the word CLONE to the titles of the tasks and subtasks instead of cloning the titles as is which do not change from Epic to Epic. How to I fix this so the Epic title changes when cloned and the word CLONE is not added to the Epic title or any of the tasks titles?

 See screenshots of Automations here:

Jira Clone Epics With Tasks Rule Screenshot.JPGJira Clone Subtasks Rule Screenshot.JPGJira Conference Event User Assigned Rule Screenshot.JPGJira Epic Cloning Automation Rule Screenshot.JPG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

when I clone the Epic there is a section in the automation that will ask me for the new name of the Epic. When I fill in the name and select for the template to be cloned it does not change the name to the new name I entered and it adds the word CLONE to the Epic title. It also adds the word CLONE to the titles of the tasks and subtasks instead of cloning the titles as is which do not change from Epic to Epic. How to I fix this so the Epic title changes when cloned and the word CLONE is not added to the Epic title or any of the tasks titles?

There is a global setting that can be used to automatically add the "CLONE - " prefix to issues that are created through the Clone action. That can be changed only by a Jira Product Admin.

However, whether cloning manually using the Clone Issue action while viewing an issue or through the Clone Issue action in an Automation rule, you have the opportunity to override the Summary field.

What are the details of the Clone Issue action in the below rule?

Screenshot 2024-12-02 at 12.21.03 PM.png

If you want to customize the Summary of the newly created issue you should be able to do that by modifying what appears in the Summary field in that action.

Screenshot 2024-12-02 at 12.25.14 PM.png

As shown, by default the Summary of the newly created issue will copy the summary of the source issue ( {{issue.summary}} ) and prefix that with CLONE - 

You can change that field to change what text is placed in the Summary of the newly created issue.

Heather Hanselmann
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!
December 2, 2024

@Trudy Claspill so to clarify, if we want the Title of the Epic to change each time we clone it a Product Admin has to do that? I am a Project Admin so I can not change the Epic title each time I clone it through an automation?

 For the cloning of tasks, we currently have this in place but I do not need this to change on tasks and subtasks. I only want the word CLONE to be removed each time I clone from the template on tasks. The titles of the tasks will stay the same every time. Thank you for your help!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

if we want the Title of the Epic to change each time we clone it a Product Admin has to do that?

No. What a Jira Product Admin can do is specify the prefix text that will appear automatically each time the Clone Issue feature is used.

As an end user you have the opportunity to override that text when you execute the Clone Issue feature and before the cloning actually occurs.

Through the Automation rule you would change the text in the Summary field that I highlighted in with the red box in my previous response. Here is an example of the text having been changed in the Clone Issue action.

Screenshot 2024-12-02 at 12.41.55 PM.png

 

You can also use smart values in that field.

For your tasks and subtasks since you want the Summary of the source issue but not the CLONE - text, just delete the CLONE -  text from the field in the Clone Issue actions where you are creating the tasks and subtasks. Leave the field content as {{issue.summary}}

For the Epic, since you are prompting the user for the the new name of the Epic, use the smart value from the user input prompt to set the field.

Screenshot 2024-12-02 at 12.46.45 PM.png

Suggest an answer

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

Atlassian Community Events