Jira/JQL filter for issues that haven't changed status within last X working days - jira

I'd like to find all issues that haven't changed their status with eg 2 working days. I would be ok with ignoring bank holidays but would like to ignore weekends. Any hints?

Jira out of the box doesn't have the facility to ignore vacation days in JQL
JRASERVER-22506 - JQL search with working days range
This thread might be helpful
How do I create a JQL query which uses dates but allows for non-working days?

Related

How to write a query in (Jira Query Languange) to restrict issues by week number?

I have the query written in Jira Query Language
assignee was brad and status was WIP DURING ("2019/1/20", "2019/1/26")
which works but I'd rather write
assignee was brad and status was WIP DURING week("2019", 4)
which is easier to formulate. Is this possible in JQL?
Unfortunately JQL doesn't provide a function returning the time period of a given calendar week.
To not always having to look up the begin/end dates of each calendar week one could think of a workaround using the startOfYear() function. Your example would be in that case:
assignee was brad and status was WIP DURING (startOfYear("4w"), startOfYear("5w"))

TFS query for items completed yesterday to use weekdays

I have a query for "items completed yesterday" which is super useful in standups.
But #today - 1 seems to look at calendar days, not weekdays/workdays meaning that my query isn't useable on Mondays. Is there a way to tweak it to work?
Unfortunately we cannot achieve that.
You can Set working days for team's sprint planning and tracking when calculating capacity and sprint burndown, however it's not apply to work item queries.
So, as a workaround you can create another query with Closed Date = #today - 3 specified if you are using the normal working days...(Means the "Yesterday" is Friday)
More information please see Query by date or current iteration.

Jira - JQL report to show average number of resolved/created tickets over 30days

I'm trying to figure out how to create a JQL query that will pull back the average number of resolved tickets over the last 30 days and the average number of created tickets over the last 30 days...
I've used the created resolved report in Jira which is great, but now I just need the averages calculated..
I'm quite sure that this cannot be achieved using the out-of-the-box JQL.
You can do this easily using Jira's remote API, using jira-python for example :
from jira.client import JIRA
jira = JIRA(basic_auth=('admin', 'admin')) # a username/password tuple
props = jira.application_properties()
# Find all issues from the last month:
issuesResolved = jira.search_issues('resolved > startOfMonth()')
issuesCreated = jira.search_issues('created > startOfMonth()')
# and so on...
What should the output be exactly? average per day for the last 30 days? average for every 30 months?
Anyway, if you need help coding that let me know... good luck !

"complex" grouping and sorting with sunspot

I have a problem to which I can't seem to find a solution.
I want to achieve the following:
* i have a list of tasks, each with an owner and a due date
* i want to display a list of all tasks grouped by owner
* i want to sort the owners based on the due dates: e.g. The owner with the lowest due date first, followed by the owner with the second lowest, etc
To ilustrate, this would be a result i am looking for:
Harry
- task 1, due date 1
- task 3, due date 4
Ben
- task 2, due date 2
Carol
- task 4, due date 3
I am using sunspot to search and filter results, so ideally i would like to use sunspot to do this. I've been trying to get the results with facets and ordering but haven't gotten this result to work yet(i can group by owners, or order by due date just not both).
Any help would be appreciated.
Erwin
What you want to use is the Result Grouping/Field Collapsing feature of solr.
Unfortunately, this is a fairly new feature in solr, and isn't yet supported in sunspot (as of 1.3.0). However, it is under active development and explicitly listed as a feature for a "future release". This might be soon-ish, as a pull request for this feature was just submitted a couple days ago.
If you haven't found a workaround, you could grab the code from that pull request and see if it does what you need it to do....always fun to walk on the bleeding edge, right? :)
UPDATE: Support for field grouping was just merged in to the master branch of sunspot. Check it out. The readme for sunspot has been updated with examples of how to do exactly what you're trying to do.

Find WorkItems that were assigned to X in the last 30 days

I'm trying to find all WorkItems that were assigned to a person X in the last 30 days.
The big problem I have is the "in the last 30 days"-part.
I thought about using the "ever" or "asof" keywords, but couldn't find a good answer yet.. something like WHERE [Assigned To] = 'X' AND (([Assigned To] != 'X') asof '<30daysago>').
But this is still not a bulletproof solution.
Any better ideas?
Thanks & kind regards
Simon
It appears that this is not possible using just WIQL, but you can get close.
The keyword #Today will give you today's date, then just subtract your range from it. The EVER keyword applied to [Status]='AssignedTo' and a comparison against a date 30 days in the past to [StateChangeDate] is what you'll need to accomplish this.
As close as you can get with WIQL and existing fields:
This says, from all revisions (status changes) return records where the user 'X' has ever been AssignedTo and the State has changed in the last 30 days. This will basically give you a slightly fuzzy picture of what your User has been working on in the last month.
WHERE [Microsoft.VSTS.Common.StateChangeDate] >= #today - 30
AND [System.AssignedTo] EVER 'Bennett Aaron'
ORDER BY [System.State]
Add the missing field:
You could add a custom field called AssignedDate that is captured during the New->AssignedTo workflow transition that you create in the Work Item Definition XML. You can accomplish this using the Team Foundation Server Power Tools extension to Visual Studio. This would give you exactly what you need as well as additional reporting options going forward.
TFS API
I cannot help you with this one, but I believe you could query using the TFS API.
A couple of quick gotchas I've experienced to save you time on ASOF and EVER:
AsOf won't help you by itself with this as it does not support a range of dates. It allows you to query as if it were another date. In other words, if you forgot to capture the results of a query yesterday, you can use an AsOf query to get the results that you would have gotten had it run yesterday. What I understand is that you want to query a basic date range.
EVER might not work as you expect against dates as I believe it uses the exact value of the field (timestamp portion of the date field would be included) it tests with. Just make sure the EVER keyword is used against the status field rather than a date.

Resources