I want to set a timestamp on an issue created through automation for the end of the automation's given day.
I've been playing around with {{now.plusHours(8)}} to achieve something similar, but want to know if it's possible to do something like: {{now.endOfDay}} ?
An alternative would be to set a static time, something like this: {{now.(6:00 PM EST}}
Thanks in advance!
Hello @Hartej.Gill
Welcome to the Atlassian community.
Based on this documentation there is no "endOfDay" function that can be used to set the time portion of a date/time field.
If you are looking for a function that set the time based on the end of your business hours vs. the end of the actual day, there are no functions specific to interpreting your business hours. If 6 pm in a specific time zone is the time you want, and that is 8 hours after the automation has run, then you idea of using now.plusHours(8) is the best option.
However, if you are looking to set the time to midnight, there is a toStartOfDay function. You can use that to get what you want by setting the time to 00:00 for the next day.
{{now.toStartOfDay.plusDays(1)}}
Or you can use the above and then subtract 1 minute to set the time to 23:59 today.
{{now.toStartOfDay.plusDays(1).minusMinutes(1)}}
If you wanted to use only business days in the calculation you would need to use plusBusinessDays. If you wanted that to be based on a particular timezone other than UTC you would have to add the function to convert it to a specific time zone - convertToTimeZone()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.