Filtering issues to exclude the ones raised on business hours

Thiago February 10, 2015

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

0 votes
João Palharini
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2015

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 Sign up to answer