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

0 votes

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
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

27,272 views 2 7
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