Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Help - Writing an automation that clones tickets with a specific label every month

Bill Mc April 8, 2024

Current state:

  • For compliance, certain tasks must be performed monthly
  • Created a template ticket and gave it the labels MONTHLY and TEMPLATE
  • Started an automation scheduled on the first monday of each month with JQL looking for tickets with both labels

What I'm trying to do, but... am beyond my depth:

  • Branch for each ticket in the results to clone them to the same project and add the current date to the summary
  • exclude all the clones that are getting created each month from the query by REMOVING TEMPLATE label from the created tickets

Hopefully this makes sense.   Any and all help is greatly appreciated!

 

2 answers

1 accepted

2 votes
Answer accepted
Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

Hi @Bill Mc ,

I would prefer to filter the exact Issue key of all template issue instead of label (monthly and template), this may accidentally cause additional ticket cloned if other user added month and template in there ticket labels.

But its up to you.

You can use this sample automation:

When: Scheduled - Run rule every (1 Month) - On the (1st day of month) - At (set time when to execute) - tick the "Run a JQL search and execute actions for each issue in the query." - input this JQL(use your template ticket key): 

key in (ticketkey-1, ticketkey-2) 

or use label if this what you want:

labels = MONTHLY AND labels = TEMPLATE

 

and uncheck "Only include issues that have changed since the last time this rule executed"

image.png

 

Then: Clone issue - update all field needed

Summary: {{issue.summary}} {{now.mediumDate}}

Labels: Monthly

 

image.png

Hope it helps!

Bill Mc April 9, 2024

I was certainly overthinking this one.  Thank you so much! Worked perfectly. 
I (wrongly) was thinking I would need advanced branching to act on multiple tickets - works perfect. And, message received re the danger of using labels in the JQL; it's admittedly my being lazy and not wanting to have to update the automation every time I add a new repeatable task.   Much appreciated.

0 votes
Kalyan Sattaluri
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.
April 8, 2024

Hello @Bill Mc 

Please share what you have written for the rule so far. I am guessing you are in cloud, instead of giving JQL in trigger, you need to use lookupIssues and give your JQL there.

And then next, you do Advanced Branching (for each), give smartvalue as {{lookupIssues.key}}, give any variable name you want..

click next, choose clone action, and update your summary by appending the date, choose labels field and remove the TEMPLATE etc.

Its straight forward, try it and let us know if issues but do share screenshot of rule / audit logs.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events