Cloning a set of templated stories AND their subtasks

Simon Brooke February 16, 2018

Hi Team,

 

I want to be able to setup a template Epic -> Stories -> Sub-tasks and then have a manual rule that clones this 'tree' of issues...

 

I've managed to get part of the way there, in fact the Epic is just created on the fly, then I gather up a set of Story items tagged with a 'template' component and link them to the Epic, but, as the branching rule condition cannot be nested I can't see a way of cloning the story items and their sub-tasks...

I could theoretically allow the rule to call another rule, but that seems a little dangerous...

Any advice on this?

Thanks,

Simon

1 answer

1 accepted

0 votes
Answer accepted
Nick Menere
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.
February 18, 2018

Hi Simon,

 

For this I think you are better off doing this 2 rules:

  • 1st rule will create the Epic and stories
  • 2nd rule will create the sub-tsks

First rule should be fairly simple.

  • Manual trigger
  • Create or Clone Issue action to copy the Epic
  • Branch on all Stories
    • Create or Clone to create the new Story.
    • Set the Epic to: {{createdIssue.key}}
    • Set a property on that issue during the create action by using the following in the More options - Additional fields
{
"properties": [
{ "key": "orig-story", "value": "{{issue.key}}" }
]
}

 

The second rule:

  • Issue created Trigger
  • Condition to check that is a story in the project you want
  • Branch on JQL:
    • parent = {{issue.properties.orig-story}}
    • This will iterate over the original sub-tasks
    • Add a Clone/create and select a sub-tasks type
    • Set the parent - {{triggerIssue.key}}
  • After you save the rule, you will need ensure the rule is either Global or has both projects in the scope, and also check the box to allow other rules to trigger it.

 

This is a fairly complicated rule but we have had talks internally about Syncing/Cloning a hierarchy. This would make it trivial.

 

Cheers,

Nick Menere [Code Barrel]

Automation for Jira

Simon Brooke February 19, 2018

Ah, awesome, I couldn't quite understand how properties worked, that's great, many thanks,

 

Simon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events