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

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"))

Related

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

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?

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.

How to find all jira issues which are assigned to me between given dates?

I would like to filter out all issues which were assigned to "XYZ" between 1st May to 5th May.
Note:- assignee may be changed in between so i used 'was'
I wrote this query
assignee was XYZ AND updatedDate < "2017/05/06 00:00" AND updatedDate > "2017/04/30 00:00"order by updated DESC
But, all is correct except this fails on one special case.
This is giving me those issues too which were assigned to me earlier before these dates --
because these issues may be updated in these dates range.
I could not sort it out as there is no such thing assignedDate in Atlassian.
Please help me out.
You can combine the WAS operator with a DURING clause, e.g.
assignee WAS xyz DURING ("2017/05/01","2017/05/05")
The JQL operators documentation also contains some examples.

Jira JQL equivalent to Group By

I'm trying to pull a report, (a pie chart or just a list) on amount of assigned issues in the last month by assignee.
Also is there any way to do an average age report, but per user as well?
The Group By part comes from using the Issue Statistics gadget to summarize a report by a particular field such as Assignee. Most but not all fields appear in the list of fields to summarize by.
~Matt
Not sure if this is what your looking for:
Go in to Issue and query for createdDate >= -30d, this will give all issues created in past 30 days.
next go to views>pie chart>Save to dashboard add filter name
Then you can edit the statistic type to display by assignee.
In addition to Matt's answer, you can also use a 2 dimensional filter statistics, which is more detailed.

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