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 Sign up to answer
Community showcase
Published 15 hours ago in Jira

How you can achieve compact and easy-to-maintain workflows in your JIRA( Server)

This approach requires you to have the JIRA administrative rights. The main aim of this article is to help you achieve an organized, easy-to-maintain workflows in your JIRA instance thereby, reducin...

143 views 0 0
Read article

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