TFS query for items completed yesterday to use weekdays - tfs

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.

Related

How to use startOfYear()/endOfYear() functions in Jira JQL?

I am trying to churn a report using JQL filter that displayed monthly ticket assigned to particular person in a year.
I am really confused regarding the usage of StartofYear() and EndofYear()
Since we only started using JIRA in November, below query should return data for the month of November (11M) but I am not sure why, the query below is not returning any data...
after startofyear("+11M") before endofyear("+11M")
From what I understand, the above query should return data from Starting of November to end of November right?
The offset parameter in the startOfYear/endOfYear functions is the offset of whole years (e.g. startOfYear(-1) means start of the last year).
Also, you need to specify an object that you want to limit to these months (e.g. issues created or resolved). And you need to use different operators.
In your case, you need to use any of the following JQLs:
created >= startOfMonth(-1) AND created <= endOfMonth(-1) (for November when executed in December)
created >= 2021-01-11 AND created <= 2021-11-30
Instead of <= endOfMonth(-1) you can use < startOfMonth().
See also more information in Atlassian Documentation.

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?

Sort TFS Query By Itaration Start Date

I have TFS/AzureDevOps query which is sorted by Iteration Path .
I need to sort it by Iteration Start Date.
I dont see any option on the Sorting Page or in the query page to sort like this.
I tried sorting by iteration ID but the iteration were not created in order .
WIQL Code
SELECT
[System.IterationPath],
[Prod.Versions],
[System.Id],
[Prod.Territory],
[Prod.Customer],
[System.Title],
[System.AssignedTo],
[System.State]
FROM workitems
WHERE
[System.TeamProject] = #project
AND [System.WorkItemType] = 'Feature'
AND [Prod.Versions] >= '9.0'
AND [System.IterationPath] <> 'Machine'
AND [System.AreaPath] UNDER 'Machine\Development'
ORDER BY [System.IterationId],
[System.Id]
i would like it to be ordered like the following (this is from the setting page of the project in AzureDevops Server 2019 ):
We have adopted a naming convention for our iterations that uses the start date of the iteration as the name in order to achieve this.
So the iterations are named like:
2019.08.12
2019.08.26
not ideal, and I would love to see a option to include the iteration's start date a column for this very reason. Hopefully we will see a better answer soon.
Sorry, TFS work item query not support to filter Iteration using Start/End Dates.
There is a similar question here: TFS show iteration Start and End Date on PBI
Since using a name contain iteration date is not a solution for you. As another workaround, you could try get Iterations in specific Start/End dates using TFS API. Some thing maybe helpful for your reference.
Besides, in each collection database there is a table called "tbl_nodes" that holds the start-date and the end-date.
Writing a warehouse adapter that actually picks up these dates and saves them to the warehouse. Note do not write or change anything directly in database which may lose official support.
For query work item using Iteration Start/End Dates scenario, please submit it to User Voice site at: https://developercommunity.visualstudio.com/spaces/21/visual-studio-team-services.html?type=idea Microsoft engineers will evaluate any feature request seriously.

Jira Agile: How to report by Epic, by Story/Parent, by Subtask?

I would like to get a summary report of my sprints and what happened with my tickets. I'd like to see aggregations by epic, then by story, with the leaf level being the subtickets on a story item.
Is there any way to do this? I Can get the particular sprint's information, but that's as far as I've gotten.
project = "ADS Agile" AND assignee = MYNAME AND resolution in (Completed, Fixed, "Cannot Reproduce", Approved, "Won't Fix", Duplicate) AND sprint = 100 AND resolution = Completed ORDER BY summary ASC, key ASC
//edit Example output;
T Key Summary Assignee P Status Resolution Created Updated Due Time Spent Original Estimate
Sub-task AGILE-35
AGILE-30 (New) Decide whether to use existing system.
Anne Normal Closed Completed 01/12/15 01/15/15 2 hours 2 hours
Story AGILE-31
As the PO of ss, I'd like tests for each path.
Anne Normal Closed Completed 01/05/15 01/29/15 1 week, 4 days, 1 minute 4 days, 4 hours
Probably the easiest way to do it would be to run the query you have now and then export it to Excel. You should be able to do the aggregation you want within Excel.
In the list of query results, select the columns you want before exporting to .csv. Easier than eliminating from Excel.
Reorder and organize the columns as you wish before the export as well.
Then save the query so that it appears as you wish.
Jira will never display the stories -under- the epic, which is very frustrating. But displaying the name of the epic link will do the trick.
Realizing that the original poster certainly figured this out a year ago, but thinking that others might have the same question.

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