how can I create a filter with time range

I have 3 filters :

Day tickets

project = ST AND created >= "2015/08/10 7:00" AND created < "2015/08/10 17:00"

Evening tickets

project = ST AND created >= "2015/08/10 17:00" AND created <= "2015/08/10 23:00"

Night tickets

project = ST AND created > "2015/08/10 23:00" AND created < "2015/08/11 7:00"

 

I would like to know the number of tickets by day, evening, night in the month or in a week.

Is there a way to achieve this ?

I have JIRA 6.4

Plugins : EasyBI, Script runner, JIRA Workflow toolbox, JIRA Misc Custom field, JIRA Automation

2 answers

First of all, thanks for including your JIRA version and your plugins in the post. So few people do that.

I'm not sure I get the meaning of your question though. You have your queries already, and they look good to me. Do you mean that you would like something dynamic and not have to specify the exact date? Something that would mean "I want to see all issues reported between 7:00 and 17:00 for the previous week"?

You can get half way there with some JQL functions built-in (startOfWeek(), startOfMonth()), but it's not like a cron pattern.

Maybe you could compose a horrible query that goes something like this: created > startOfWeek(7h) AND created <= startOfWeek(17h) OR created > startOfWeek(31h) AND created <= startOfWeek(41h)...

The query for issues in a month would be horrendous. In fact, since month length vary, you wouldn't be able to make a reliable query that works for every month.

I'm afraid you'll have to create your own JQL function using ScriptRunner, unless somebody else knows of a plugin that does more flexible queries based on times?

 

Do you mean that you would like something dynamic and not have to specify the exact date? Something that would mean "I want to see all issues reported between 7:00 and 17:00 for the previous week"? Yes exactly !

Yeah. That sounds like something that would be easy to do in SQL, but there's no distinct Time field, so I don't think there's a simple built-in JQL solution. If you don't mind querying the database directly, you could get the list of issues, and make a query for that list of issues in JIRA. Sounds like more work than changing the filter each week/month... I'll let you do the cost/benefits analysis: Is the added value of a permanent filter worth the time to script a custom function or use SQL to query the database directly?

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,042 views 13 18
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