Getting state change for work items by sprint not date from Azure DevOps - rest

I'm trying to collect the state of work items as it were in a particular iteration. I'm capable of getting the present state of the work items with a query to the REST API like this one:
https://analytics.dev.azure.com/{organisation}/{project}/_odata/v2.0/WorkItems?$expand=Iteration.
It does give me the creation, activation and completion date but I need to know which iteration it was created, activated and completed in

The solution turned out to be very simple. It had simply eluded me when searching
https://analytics.dev.azure.com/{organisation}/{project}/_odata/v2.0/WorkItemRevisions?$expand=Iteration
returns all revisions of the work items, including what iteration they were assigned to when the change happened

I need to know which iteration it was created, activated and completed
in
For this demand,you can try to use this rest api:
GET https://{instance}/{collection}/{project}/_apis/wit/workItems/{id}/revisions?api-version=5.0
With this rest api, you can list all the revisions of the work item,and in each revision,you can see the iteration path of the work item and the state of the work item at that time.
The downside is that it can only be used for one work item. If you want to collect all the work items, it will be a bit cumbersome.

Related

Is it possible to query in ADO by work item created in the current iteration? So that the query can update with each new iteration

I would like to display the results of a query that identifies the bugs created in the current iteration. AKA "new bugs". I know this can be done by using the created date but that requires the date to manually updated for each new iteration.
Is it possible to leverage the 'current iteration' in the query? Or some way that does require a manual update.
I have tried using only 'current iteration' but this returns all bugs in the current iteration limited by the state that I specify. The result is not limited by when it was created.
I have tried to add a clause for created date, which works, but is not dynamic. meaning it does not increase as the iteration grows in number of days.
Yes, you can add a and/or clause like below
I have a second drop-down list as we have different Teams, so it wants me to tell it which Team I want to bring back items for, from the #CurrentIteration.

Defining an Azure Board query that tracks work I have performed during current sprint - at any given time within that sprint

I am trying to come up with n Azure Board query to return the work I have performed during current sprint - which I am vaguely defining as:
Work In Current Sprint = [A] + [B]
where
A = work items where I completed development stage (or was decided at some point work is irrelevant) and
B = work items I created in current sprint, not necessarily assign to me nor my team (I spent time investigating an issue, and ended up, for instance, finding a bug, so I want this included in this "report").
The closest I could get is the query blow. Problem is it is still not quite accurate, since with regards to items I created during this sprint - I could not find a way to filter created items in this sprint only - results are showing up work items that CURRENTLY BELONG to current sprint, but not necessarily created in current sprint. The only way I see I can achieve what I want is using CreatedBy - but this only provides a "hardcoded" date range offset, at any given time. If I use an offset of 14 days backwards, running query at the last day of the sprint (considering a 2 week sprint duration) should work, but running the query at any day before that, during the sprint, will return stuff created in previous sprints.
I want this query to help me track "work I have performed during current sprint" (as defined above) at any given day within the sprint.
Any better ideas ?
You could use custom date in 'create date' to limit the work item.
And I notice you use 'work items and direct links', then you need set filters for 'Filters for linked work items' part(as you needed, like iteration path etc.). Otherwise it may return linked work item that belong to other iterations, according to the filled filter, like something belows:
I hope it could help.

How to show changed Work Items using Azure DevOps Queries (Audit-like query)

Trying to resolve how to get a list of all changed Work Items from a Backlog within Azure DevOps using queries, so far not successful.
Reason for this query, is that our organization is still fairly new to ADO and are still changing/tinkering with all WITs.
As of this, a query would fill the gap, to display who and what have changed on every WITs.
Currently tried tinkering with the following attributes [Changed Date, State Changed Date, etc.]
Although unfortunately, this ‘only’ shows some WITs and not WITs where say, Assigned To, Title, Target Date or any other field might have been altered.
I could do a query, but I reckon it would be a massive query which, in the end, might not even function
The History field might do the trick, but that's not an Attribute which one could use in a query?
Would it be possible to get an, say Audit-like query, which displays every change made to WITs during the last +30 days or so?
Br

Is there a way to filter an Azure DevOps board using dates?

On the Boards section of Azure DevOps, there's a nice filter bar. It contains filters for:
Type
Assigned to
Tags
Iteration
Area
Parent work item
As far as I can see, there's no way to use the section outlined in yellow to filter for work items (for example) created within the last seven days, or due within the next 14 days.
Things I've tried:
Creating a query and viewing results as a board (can't see an option to do that)
Finding a way to script work items into iterations based on date, and then filtering the board based on iteration
Is there a way to do this? It's specifically a board I'd like, as opposed to a Backlog-style list.
Just change the board's settings, Is this what you want?

What is the proper way to keep track of updates in progress using MondoDB?

I have a collection with a bunch of documents representing various items. Once in a while, I need to update item properties, but the update takes some time. When properties are updated, the item gets a new timestamp for when it was modified. If I run updates one at a time, then there is no problem. However, if I want to run multiple update processes simultaneously, it's possible that one process starts updating the item, but the next process still sees the item as needing an update and starts updating it as well.
One solution is to mark the item as soon as it is retrieved for update (findAndModify), but it seems wasteful to add a whole extra field to every document just to keep track of items currently being updated.
This should be a very common issue. Maybe there are some built-in functions that exist to address it? If not, is there a standard established method to deal with it?
I apologize if this has been addressed before, but I am having a hard time finding this information. I may just be using the wrong terms.
You could use db.currentOp() to check if an update is already in flight.