Forums

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

How do I use automation to clone and Epic + child issues when a new sprint is created?

Kythera
Contributor
January 4, 2024

Hello everyone!

Preface: I know next to nothing about automation. Regular syntax? Smart values? These are complete mysteries to me and the documentation makes NO sense whatsoever because I don't think I have sufficient background knowledge to understand what any of these things mean, and documentation is no help at all. For example, the information in the link provided in "Need help with syntax? Check out the regular expression documentation." means NOTHING to me. I don't understand what any of the content is talking about, and there's no indication of what I should read to gain the information/background knowledge I'm missing. It might as well be written in Cuneiform and complaining about substandard copper ingots. 😓

That said, I understand this may a big ask because I need a LOT of hand-holding here.

What I'm trying to do is set up an automation rule that will do the following:

  1. When a new sprint is created
  2. Clone an Epic AND its child issues
    • Ensure the cloned child issues are linked to the newly-created Epic, not the source Epic
  3. [Optional] Delete the issue links within the cloned Epic and child issues

Why do I want to do this?

There are certain tasks that need to be done EVERY sprint. Using automation to clone the Epic and child issues will save the time of manually cloning, linking, and updating the epic + children from scratch for every single sprint.

The screenshot below is as far as I've gotten:

Screenshot_5.png

I don't understand how to address the error, let alone get any farther. As far as I can tell, there is no way to indicate the "[required] issues to be provided by the trigger." There's a branch. There's a JQL query that points to the Epic to be cloned. What am I missing?

I'm lost. I've searched high and low and I haven't found any Community threads that adequately explain steps that will do what I'm trying to do. So I am swallowing my pride and placing myself at y'all's mercy.

Can you help a desperate admin out?

Thanks in advance!

4 answers

1 accepted

2 votes
Answer accepted
Walter Buggenhout
Community Champion
January 4, 2024

Hi @Kythera ,

After such an extensive write-up, it would be a shame not to try and help. As it happens, there is a sample rule in the template library that does most of the work you need. This is a link directly to that rule in the library.

The rule - as it is - is designed to be triggered manually from the epic you want to clone. If you set up the rule and then open an epic, you will be able to see and fire the automation from here, under Actions:

Screenshot 2024-01-04 at 20.00.55.png

Maybe that is sufficient to get started, but it does not get fired automatically when a sprint is started. And that is where things may get tricky ...

The branch in your screenshot won't work. It needs to be a For JQL trigger in order to perform the clone issue action on your epic, like this:

Screenshot 2024-01-04 at 20.05.24.png

As you will see from the template rule, you then need an additional branch to also clone the linked issues. And that is not possible, as you cannot add a branch to another branch.

A solution might be to create a second automation that is triggered when an epic is created and then copies the stories into that epic from the original epic. But since that should only happen when the epic was created automatically in response to the creation of a new sprint, that may come close to rocket science in terms of conditions, so you don't end up with lots of unwanted issues.

Hope this helps!

Kythera
Contributor
January 22, 2024

Hi Walter!

This helped A LOT!! My deepest gratitude! I can handle one click to clone my set of issues for each sprint. Not perfect, but it significantly reduces my workload/time sink which was the primary goal.

The only problem I run into now is how to link the cloned child issues to the cloned parent. For now I have to manually go in and link/re-link each issue. At least I have core functionality I can troubleshoot now, which is much farther along than I was before!

Figured it out! Huzzah!! 😽

장경호
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!
June 11, 2024

How were you able to ensure that the cloned issue remained linked to the original when you resolved the parent issue through automation rules?

1 vote
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.
January 7, 2024

Hi @Kythera 

Adding to the suggestions provided by others...

Successfully using automation rules requires learning and experimentation.  When using rules provided by others (or the templates) without understanding the automation rules, very bad things can happen very quickly to a Jira instance...perhaps wrecking havoc upon the Jira issues.  And as you appear to be using a Free license level, that level precludes contacting the Atlassian support team for help.

And the documentation example you noted which caused confusion is for regular expressions for text matches.  That is a fairly advanced topic, and so I would not expect it is needed by many Jira automation rule writers...and it is probably not needed for your scenario.

I recommend starting with the more basic documentation first, such as linked below.  Then create a test project to experiment with rules and learn as you progress using rules.

https://www.atlassian.com/software/jira/guides/automation/overview#what-is-automation

Kind regards,
Bill

Kythera
Contributor
January 22, 2024

Gratitude for the link to the basic documentation. I knew I was missing something, and sure enough.

Fortunately, the free version I'm using is my personal/private instance, specifically for experimenting so that I don't do any lasting damage to my employer's instance. Although, I'm seriously considering upgrading to Premium for my own purposes, as Jira has actually been helpful in managing my ADHD.

1 vote
Rebekka Heilmann _viadee_
Community Champion
January 4, 2024

Hi @Kythera 

The Error message is explained like so:

Your trigger will give you some sort of return value. Your trigger "when sprint is created" will give you a reference on the Sprint, that has just been created.

Branching works a bit like For-each-loops (for every item i give you, do xyz). In your branch you are referencing a "current issue". But there is no "current issue", as your trigger only give you a sprint.

To achieve your logic, you would need to look up the Epic, clone the epic, then branch on all children and change their parent.

However, you will have issues running that rule automatically, as Jira would have to know what Epic you want to clone. As there is probably no foreseeable pattern in the id/name, that is gonna be difficult.

 

It would probably be easier, to trigger the rule manually on the Epic itself. Then your trigger will give you the epic and you can go from there. If you give me a bit, I can probably put together the rule for you.

Automation is fairly simple, if you have basic understanding of programming logic. Otherwise, it's a nightmare. I feel you ;) 

Kythera
Contributor
January 22, 2024

Yeah, I have next to no understanding of programming logic. Not for lack of trying, believe me. I just can't wrap my brain around much more than ye olde "Hello world!"

Manually triggering the rule seems to do the trick. It's not ideal, but it's enough to save significant time and frustration, which was the primary goal. With the help of @Walter Buggenhout's explanation and examples above, I got it to do what I need it to do. 

Like • Rebekka Heilmann _viadee_ likes this
0 votes
Luka Hummel - codefortynine
Atlassian Partner
January 25, 2024

Hi @Kythera

if you have problems with your automation, you could also try our app Deep Clone for Jira.

Deep Clone allows for bulk cloning of issues (including Epics and their child issues) and provides options to adjust links during the cloning process. This could simplify your workflow significantly.

I would suggest just trying out the Epic/Tree Clone feature and maybe setting up an Epic/Tree Clone preset that you can quickly reuse.

If you still want to use a Jira Automation to trigger your clone, we just released the possibility to create Epic/Tree Clone post functions, which in turn enables you to use a Jira Automation to trigger the clone. You would still need to define the target issue in a For Branch like @Walter Buggenhout has already pointed out.

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