Filtering issues to exclude the ones raised on business hours

Hi All,

At our company we use JIRA OnDemand and its Service Component for support tickets.  I have a web hook that needs to fire only when support tickets are raised outside business hours – meaning on weekends, or from 6pm to 9am on week days.

Can I please know the best way to achieve this using JQL ? Are there custom plugins / functions required for this? Or can it be achieved with JIRA OnDemand without the need to write custom functions?

Thank you.

1 answer

Hi Thiago!

I did some research and tests over here and couldn't find a JQL function advanced enough to run this kind of query. JQL is very limited at this point, so I wasn't able to use any type of truncation to get only the time of creation without considering the date. This could only be achieved if you run one query for each day you want to have information, what doesn't seem to be very easy at all.

The only ways I could find here would require a JIRA Server instance (hosted by your company instead of us), so that you would be able to run SQL queries directly on the database.

Anyway, as this can be useful for other people, I will post the way to do that through SQL on a JIRA Server instance:

SELECT * FROM jiraissue WHERE EXTRACT(HOUR FROM created) BETWEEN 18 AND 9 OR EXTRACT(ISODOW FROM created) BETWEEN 6 AND 7;

Cheers!

Joao

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,233 views 14 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot