I have two lookup tables, one defines the start hour and the other defines the end hour.
I need to create a variable which will either be true or false based on whether the current hour is within the range. I've tried the following smart value but Jira can't render the value
Based on the value of the variable, another value will be set to true or false.
Here's the smart value formula I'm trying to get to work.
{{and(now.convertToTimeZone("America/New_York").hour.gt(tblStartHour.get( varKey),now.convertToTimeZone("America/New_York").hour.lt(tblEndHour.get(varKey))}}
Has anyone done such a smart value calculation or have ideas to accomplish this.
Hello @Richard A_ Michaels
I recommend that you use the Log action to log the values within the smart value piece by piece to verify you are getting the hours you expect. For instance in a Log action log
{{now.convertToTimeZone("America/New_York")}}
Then in the next Log action log
{{now.convertToTimeZone("America/New_York").hour}}
Then
{{varKey}}
{{tblStartHour.get( varKey)}}
{{tblEndHour.get(varKey)}}
One problem that I suspect this may identify is that I believe this is not valid syntax:
{{now.convertToTimeZone("America/New_York").hour}}
...since hour is not one of the format key words listed here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
To extract the just the hour from the results on convertToTimeZone you would need to use the format command with a valid input as described here:
I think what you will need to use is one of these
now.convertToTimeZone("America/New_York").format("h") - to get the hour as 1-12
now.convertToTimeZone("America/New_York").format("k") - to get the hour as 1-24
Hi Trudy,
Thanks for your reply.
This smart value, {{now.convertToTimeZone("America/New_York").hour}}, worked as expected. The issue was more centered around the fact that I needed to determine whether the current hours was between two values which are extracted from the tables.
I resolved my issue outside of Jira automation, which means Jira automation will be doing much less of the actual processing.
Thanks,
Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Richard,
I'm glad you found a solution.
Can you share the details, for the benefit of other folks who have a similar need and find your post?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Trudy,
I moved all the functionality to Zapier. Jira automation just send specific information to Zapier and Zapier calls an incoming webhook with the issue key and result
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.