Forums

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

Automation Smart Value to set First Thursday of Month

Alan Dunbar November 29, 2023

I am looking for the correct Smart Value with Automated Tickets to create a date which is the first Thursday of the following month.  

E.g  Jira Automation creates the ticket on the last day of the current month & the start or due date of the ticket should read a date corresponding to the first Thursday of the following month

 

Can someone please help?

Cheers

Alan

2 answers

2 accepted

1 vote
Answer accepted
Salzi
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.
November 29, 2023

Hey @Alan Dunbar

try:
{{now.plusMonths(1).firstOfTheMonth(4)}}

It is actually quite simple. You have a date (now), you add a month to it (.plusMonth(1)) and then you jump to the first Thursday (.firstOfTheMonth(4))

look here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

Best Salzi

Alan Dunbar December 1, 2023

Fantastic Salzi.. just what I am looking for and it has allowed the "penny to drop" in terms of understanding some of the other Smart Value syntaxes...  Much appreciated.

0 votes
Answer accepted
Antuan Sammak
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.
November 29, 2023

Hi @Alan Dunbar 

 

Welcome to the Atlassian Community!

 

you can refer to the below, more info can be found here https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

also, your automation rule needs to be Scheduled based and their you can control the config of when it will run on Monthly basis

Next day of week {{[date].withNextDayOfWeek(["day"])}}

Sets the date to the next matching day. If you're already on that day, then it will return the next week. You can use the following values: MON, TUE, WED, THU, FRI, SAT, SUN.

Example of {{[date].withNextDayOfWeek(["day"])}}

1 {{now.withNextDayOfWeek("TUE")}} will return the next Tuesday.
Alan Dunbar December 1, 2023

Thank you so much for the contribution Anturan, I will add this to my snippits of useful codes.. Slight newbie around the Smart Value use here.

 

Much Appreciated

 

Alan

Suggest an answer

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

Atlassian Community Events