Forums

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

set a specific time for a given day using Smart Value

Hartej.Gill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2023

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!

 

1 answer

0 votes
Trudy Claspill
Community Champion
July 10, 2023

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)}}


Screen Shot 2023-07-10 at 5.23.27 PM.png

 

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()

Suggest an answer

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

Atlassian Community Events