Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Check time and day of week as condition?

Can I use IF / ELSE blocks with time/date/day of week?  If so, how?

 

When a critical ticket is created

... Then if I'm Monday to Friday, and it's 9AM to 5PM, then I want to assign ticket, and notify in Slack channel with a certain message

... Else I don't want to assign the ticket, and I want to notify in Slack channel a different message

 

I saw a convoluted solution to do this with JQL - so you get your run on ticket create, and if the priority is critical but then your IF is JQL with the query in - but it's not working consistently, as the trigger timea and JQL and more just aren't working together.  So I'd prefer to just use simple smart values and IF/ELSE instead.

 

I've got this but it's obviously a formula fail!

1 answer

Hi @Mark Haller 

I believe that you can do this with RegEx comparisons.  Also, you may also want to account for the time zones, such as from the reporter.

Created in weekday time range.PNG

Here are the details, if my image is not clear, using If/Else, with an Advanced Compare Condition with two clauses.

For the day of week use:

  • First Value: {{issue.created.convertToTimeZone(issue.reporter.timeZone).format("E")}}
  • Condition: exactly matches regular expression
  • Regular expression: (Mon|Tue|Wed|Thu|Fri)

For the time range use.  Please adjust your time range as desired:

  • First Value: {{issue.created.convertToTimeZone(issue.reporter.timeZone).format("H")}}
  • Condition: exactly matches regular expression
  • Regular expression: (9|1[0-7])

Please watch out for typos when entering RegEx values, as it appears the rule editor can hang when it has a problem parsing them to publish the rule.

Best regards,

Bill

Darryl Lee Community Leader Mar 11, 2021

This is really really good stuff @Bill Sheboy. Bookmarking for future possible use.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Automation

Announcing the Jira automation template library!

Hi all,  After many months of work, I am delighted to announce the launch of the Jira Automation Template Library!  The Template Library is a new website dedicated to all things Jira au...

993 views 17 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you