I'm fairly new to JSM and Atlassian as a whole and have taken over as administrator at my company in the past 6 months. I was having a hard time with trying to get this automation to work but was able to get it working after a lot of troubleshooting. I figured I would post my results here as I'm sure I'm not the only one who was having issues. Excuse me if this was already posted here or if this was common knowledge.
Figuring out the day of the week
- Work item created (or whatever trigger you choose)
- Use an IF or ELSE: Add condition options block and the {{smart values}} condition
- First Value: {{issue.created.format("EEEE")}}
- Condtion: equals
- Second Value: Saturday|Sunday (or whatever days you choose)
*NOTE: Make sure your Run actions if... is set to At least one condition matches; the "EEEE" text will output the day of week e.g. Monday, Tuesday, etc.
- Add your action (comment, edit, etc.)
- Optionally add a debug log via the Add value to the audit log action
- Debug Values: Weekday={{issue.created.format("EEEE")}}, Current Time (SET YOUR TIMEZONE)={{now.convertToTimeZone("YOUR TIMEZONE").format("h:mm a")}}
Figuring out the time of day
- In the Else-if section below that add your values
- First condition
- First Value: {{issue.created.convertToTimeZone("Your/TimeZone_Identifier").hour}}
- Condition: less than
- Second Value: 8
- Second condition
- First Value: {{issue.created.convertToTimeZone("Your/TimeZone_Identifier").hour}}
- Condition: greater than
- Second Value: 17
- Add your action (comment, edit, etc.)
- Optionally add a debug log via the Add value to the audit log action
- Debug Values: Weekday={{issue.created.format("EEEE")}}, Current Time (SET YOUR TIMEZONE)={{now.convertToTimeZone("YOUR TIMEZONE").format("h:mm a")}}
*NOTE: The second value is 1 - 24 based on the 24 Hr clock format.
I've attached screenshots from my project for reference as well since I know that seeing how it's setup is a bit easier in some contexts.
*EDIT: While this does work you'll most likely need to convert your timezone to make sure the automation runs on yours as opposed to UTC, you can use this in the Else If condition: {{issue.created.convertToTimeZone("Your/TimeZone_Identifier").hour}}


