Forums

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

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

Michael Puglin June 28, 2021

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

0 votes
Nishanth Thimmareddy (Appfire)
Atlassian Partner
June 29, 2021

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

Michael Puglin June 29, 2021

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

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.
June 28, 2021

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

Michael Puglin June 29, 2021

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)

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.
June 29, 2021

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
Like Mark SCHOFIELD likes this
Michael Puglin June 29, 2021

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 

Like # people like this
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.
June 29, 2021

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}}

Suggest an answer

Log in or Sign up to answer