Forums

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

How to automate adding past month (MMM) to issue summary clone action

Rafael Freymueller
Contributor
June 11, 2024

Hi everyone,

I have set up a basic automation that clones certain issues (based on components) on the 1st of each month. However I have ran into two issues.

Right now the automation changes the issue summary, adding the first three letters of the current month to the issue summary (see attached picture). However, I need to add the past month and not the current one. Maybe you guys can help me out on how the smart value should look for this to happen.

 

The second issue is that if for example, a ticket called "Test 123" gets cloned by the automation on the 1st of next month the new issue wil be called "Test 123 Jun", However, if the same automation goes off again the month after, won't the title look like this "Test 123 Jun Jul". Is there a way to prevent this from happening? For the newly cloned ticket I want only the original issue summary with the first three letters MMM from the past month in it.

 

As always, thanks everybody in advance for having a look at my questions! 

 

FMT1.PNG

1 answer

1 accepted

2 votes
Answer accepted
John Funk
Community Champion
June 11, 2024

Hi Rafael,

For your first need, try this: {{now.minusMonths(1).format("MMMM")}}

For the second, it will do what you are describing and tack on Jun Jul. One way to handle this is to always add a dash and then the month. So Test 123 - Jun.  Then you could try to substring out the Issue Summary to right before the dash and then add on your new month as normal. 

 

Rafael Freymueller
Contributor
June 11, 2024

Hi John,

thanks to your reply I got the first part working!

Could you elaborate a bit more on the substring function? 

How would I go about to implement that functionality in practice / how would the smart value prompt look like to achieve this?

Thanks again for helping out!

 

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 11, 2024

Hi @Rafael Freymueller 

Yes, and...to John's suggestions:

Are you trying to only update the newly cloned issue or others cloned in the past?

If you only want to update the new one, please change your branch type to Most Recently Created Issue.

Kind regards,
Bill

Rafael Freymueller
Contributor
June 12, 2024

Hi @Bill Sheboy 

There are multiple issues that need to be cloned each month, to prevent older issues from being cloned again I have checked the box for "Only include issues that have changed since the last time this rule executed".

 

For the second issue that I had with the substring as @John Funk mentioned, I have found this to work: 

{{issue.summary.substringBefore("-")}} {{now.minusMonths(1).format("MMMM")}}

 

I will mark this thread as solved, thanks everyone for helping out!

 

Kind regards,

Rafael

Like # people like this
John Funk
Community Champion
June 12, 2024

Happy to help - sorry I was too slow in responding to the substring question. Glad you got it working. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events