Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira Automation - How to clone story plus its sub-tasks

Hello,

 

We are currently using Jira Server (on-prem).  I want to create an automation rule which will clone a template ticket created by the team.   The template ticket is a story and the story has several sub-tasks. I want both the Story and Sub-Tasks to be cloned and to be associated (parent/child) just like the template.

 

Is it possible to do this?

 

For additional context:   The automation rule will be triggered when a ticket with a specific label is created on the board.

2 answers

Hi @Michael Puglin 

Cloning an issue and its related issues in one step is in the automation backlog as a suggestion:

https://codebarrel.atlassian.net/browse/AUT-998

As a work-around you could do this in pieces to clone the issues and link them, or instead have the automation rule create the template issues directly.

Best regards,

Bill

Not clear to me... what would the json look like to link the sub-tasks to the parent task?  (for use in the Additional Fields section)

Hi, Michael.

Why would you need JSON to link them?  Instead you could do the following:

  • trigger: whatever you select
  • action: create issue
  • branch: on created issue
    • action: create sub-tasks for created issue

I don't want to hardcode the tasks within the automation task.  I want the sub-tasks to be cloned from the template story.  That way, engineers (without admin access in Jira)... can simply modify the story and sub-tasks...and they will always be created correctly.  I.e., an engineer can add two additional sub-tasks to the template story and they would be cloned automatically when the parent story is cloned.

 

Not only do I want to clone the story and sub-tasks...but, I want them to be correctly associated (parent/child) within Jira 

I do not know how that is currently possible with built-in automation rules' JSON edit. After experimenting a bit with {{issue.parent.key}} and {{issue.parent.id}} (for a subtask) I was unable to change a subtask's parent.  There is more to the relationship than just those fields, and so Jira needs to manage it.

One challenge is context: the clone action to a subtask requires the parent to be either the trigger issue or the "current' issue for a context.  This might be possible with two rules if you construct the rule(s) such that:

rule 1: triggered as you need, clone the template issue, and store the template issue's key in the clone (perhaps in a custom field such as SavedTemplateKey)

rule 2: triggered by creation of a parent clone from a template, branch on the subtasks template, and clone each to set the parent to the trigger issue.  The JQL for the branch is probably something like this:

project = myProject AND issuetype = Sub-task and parent = {{triggerIssue.SavedTemplateKey}}

Hi @Michael Puglin

You can use Clone Plus for Jira Server to clone subtasks, its estimates, parent versions and the parent reporter while cloning an issue.

In addition to this, the app supports many use cases and workflow requirements with enhanced customized clone actions.

Full disclosure: I'm the product manager for the app.

Let me know if you have any questions!

Thanks,

Nishanth T

Nishanth,

 

Clone Plus looks very useful.  However, I want to perform the clone of Story + Sub-Tasks within the context of project automation.  In other words, when one story is created.. .then trigger the cloning

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you