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

This widget could not be displayed.

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?

This widget could not be displayed.

I see you have EasyBI so you might be able to try this https://community.atlassian.com/t5/Questions/eazybi-time-of-day/qaq-p/378683

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

79 views 1 0
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