Forums

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

Help with Jira Automation to clone and edit epics with its child issues

Hakim Belkouch
Contributor
September 24, 2024

Hello,

This article helped me create a manual Automation Rule to clone epics with its child issues.It's a really useful way to do something a lot of my users have been asking for.

However I would also like to edit the summary of the cloned issues. Each issue starts with a prefix and version. And I'd like to increment the version of the cloned issues.

An example if my epic and child have this as a summary :

ABC 2.1 Epic

ABC 2.1 Child issue 1

ABC 2.1 Child issue 2

I'd like the summary of the cloned epic and cloned child issues to be :

ABC 2.2 Epic

ABC 2.2 Child issue 1

ABC 2.2 Child issue 3

How can Jira Automation help me do this?

Thank you!

 

3 answers

1 accepted

0 votes
Answer accepted
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.
September 24, 2024

Hi @Hakim Belkouch 

Without seeing your complete rule for context...

Where is the number value you want to increment?  It appears to be part of the Summary of the first issue (i.e., the Epic) to be cloned.

In that case, you could use text functions, such as match(), to extract the value from the Summary, save it in a variable, and then use math functions to increment it for updating in issues.  Please look here to learn the functions to support doing this:

Kind regards,
Bill

Hakim Belkouch
Contributor
September 24, 2024

Hi Bill,

This is what I used for my variable block that I called X :

 {{{{issue.summary.substring(7,8)}}.asNumber}}.plus(1)

And this is what I used for the summary of the clone epic block :

 

{{issue.summary.replace({{issue.summary.substring(7,8))}},{{X}})}}

 

 

I'm new with smart values as you can tell, am I using the right format?

 

Thank you!

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.
September 24, 2024

You have some extra curly brackets in that expression to get the number:

{{issue.summary.substring(7,8).asNumber.plus(1)}}

To combine that with the other value, grab the left part first, followed by the number, and then followed by the right part:

{{issue.summary.left(6)}}{{issue.summary.substring(7,8).asNumber.plus(1)}}{{issue.summary.substring(9,issue.summary.length())}}

 

These assume a fixed format for the Summary.

 

Like # people like this
Hakim Belkouch
Contributor
September 25, 2024

Thank you this helped me! I managed to do it

Like Bill Sheboy likes this
0 votes
Luka Hummel - codefortynine
Atlassian Partner
September 25, 2024

Hello @Hakim Belkouch

It sounds like you're looking for a streamlined solution to clone and modify epics and child issues while also incrementing values within summaries. Our app Deep Clone for Jira could help simplify your workflow. It allows you to clone issues along with their child structures, while you could configure adjustments like replacing the version in your summary in combination with the Field Editor feature.

2024-09-25 10-04.png

This might save you some effort, especially for bulk or frequent cloning tasks!

Suggest an answer

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

Atlassian Community Events