Hi,
I found the following doc on how to use smart values to manipulate and format dates: https://support.atlassian.com/jira-software-cloud/docs/use-smart-values-to-manipulate-and-format-dates/
However, it does not state how to handle monthly dates, for example: the 3rd Thursday of every month. Is there anything that supports that? As the number of days change depending on the month.
I have done similarly with the following: {{now.plusDays(30).ofTheMonth(1, 3)}}. This gives me the first Wednesday of the following month, achieved by now + 30 days, and then "of the month" feature.
What problem are you trying to solve?
For example, are you trying to set up a scheduler for a rule on a cadence such as "the 3rd Thursday of every month"? If so, please look over the documentation on scheduled triggers and the use of Cron expressions:
https://support.atlassian.com/jira-software-cloud/docs/automation-triggers/
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
Thank you for the response. I have a date/time field in issues that I want to change. If I have an issue that has a date of November 13th @ 2PM and happens on the 2nd Friday of every month at the same time, that date field is basically a recurring date field, like you would have in a calendar. So I'm looking to manipulate the the date so if it's November 13th @ 2PM, I want that to change to December 11th @ 2PM once I call my script. I'm able to make it change to the 13th of every month or something similar, but I want it to be the 2nd friday of every month.
Thanks,
Dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm hoping there's something like {{now.2ndFridayofMonth}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interesting problem... This seems to work (and it is convulted ;^)
Let's say you wanted the 2nd Friday after whatever the current issue's updated date:
{{issue.updated.endOfMonth.withNextDayOfWeek("FRI").plusDays(7)}}
How this works:
I haven't fully tested this. You get the idea and can experiment a bit to find an algorithm that will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.