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

I need to create an automation that uses a label to create a cloned ticket with a schedule date

Sam Vanderbilt January 10, 2024

My goal is to create a label than when applied will create a ticket for every Monday, Wednesday, and Friday for the next month. For testing this, my automation is only trying to create a ticket for the next monday, but the ultimate goal is for my MoWedFri label to create 12 tickets (give or take depending on the month) for each Monday, Wednesday, and Friday in a month.

 

My automation is as follows so far:Screenshot 2024-01-10 at 11.00.55 AM.png

 

The JQL  logic seems to get ignored, so the ticket is cloned, but the field is not updated and the audit log will even say it's "successful" even though my definition of success is that the right date is applied.

I also tried using the logic:

{{issue.Scheduled Date Time.withNextDayOfWeek(["MON"])}}

which also did NOT work.

I am at a loss why this will create the clone, but not update the field "Schedule Date Time" to the value I want.

 

 

1 answer

1 accepted

1 vote
Answer accepted
Els Bassant
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 10, 2024

Hi Samuel, 

I believe the smart value should be {{now.withNextDayOfWeek("MON")}}.

  • It needs the "now" part to know where to calculate from.
  • The "MON" part should be without square brackets

Hope this helps,

Els

Sam Vanderbilt January 10, 2024

Els, thank you so much. That seems to work. I had tried to use the "now" value, before so I'm sure it was the square brackets that was the issue. I used the brackets after copying them from Jira's page with instruction on this value, so I am disappointed that was the issue.

Do you have any ideas how I can make it work without "now"? We want the label to work off the date within the "Schedule Date Time" value on the issue that we are applying the label to as opposed to "now".

So when I tried: {{issue.Schedule Date Time.withNextDayOfWeek("MON")}}, it again failed to apply a date, but it did create the clone.

The image lanaguge is  {{issueSchedule Date Time.withNextDayOfWeek("MON")}}, but i corrected it to  {{issue.Schedule Date Time.withNextDayOfWeek("MON")}} and it still did not work.

Screenshot 2024-01-10 at 12.22.58 PM.pngScreenshot 2024-01-10 at 12.23.26 PM.png

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

Hi Samuel, 

Sorry, I missed that it was based on that field. Assuming that "Scheduled Date Time" is a date field, it should work. I recommend double checking the field name and spelling.

{{issue.Scheduled Date Time.withNextDayOfWeek("MON")}}

You are missing the d in Scheduled.
So your original smart value was correct save for the brackets.

Hope this helps, 

Els

Sam Vanderbilt January 11, 2024

Thank you so much for your help, this seems to have worked!

For the rest of the automation, I added: .plusDays(X) and for X I did either 7,14, and 21 so I can get a months worth built all at once. I am unsure if there's a way to build it so that I can query it to make a clone for every monday, wednesday, and friday in a month instead of just doing next monday plus days.

This will work for now, but curious if you know of any logic that would be what I posed above.

Thanks again!

Suggest an answer

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

Atlassian Community Events