I am trying to write a Powershell script that gets all the work items that have changed in an organization after a certain Date time. I only need certain fields but right now just trying to grab all of them and dump them into a CSV. I have tried several APIs but I have been unable to get where I want to go. The Wiql api fails when there are more that 2000 items. Can anyone point me in the right direction.
#$uri = "$baseurl/$($_.name)/_apis/wit/reporting/workitemrevisions?includeLatestOnly=true"
#$uri = "$baseurl/$($_.name)/_apis/wit/reporting/workitemrevisions?includeLatestOnly=true&startDateTime=$LastRunTime&Types=$WorkItemType"
#$uri = "$baseurl/$($_.name)/_apis/wit/wiql?api-version=5.0"
#TESTING REMOVE
$uri = "$baseurl/TestingWillBeDeleted/_apis/wit/wiql?api-version=5.0"
There is a design limitation while pulling the workitems without any filters or conditions attached. As per the design, one can pull only 2000 work items at once. If you are looking to pull more than that I would like to recommend you build the Powershell script to
Step 1. Get the list of unique work item types that got altered between choose dates.
Step 2. Customize Powershell to pull the work item of individual type to each sheet in the EXCEL.
for eg: If there are changes on BUG, TASK, USER STORY work items, at the end of step 2 you can see the excel sheet with 3 sheets with individual work items dumped.
Hope this helps.
Related
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
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?
In Azure DevOps, I need to pull a report of the work done by person in order to distribute payments between team members.
Since the VSTS does not support rollup of the Effort directly:
I suggest you use query to pull out the report of effort for all teams first, then download this report and roll up the effort by person.
Step1: Go Query page, then add Effort column by open Columns Options:
Note: This steps is very import, this can help for pull out a report which contains the Effort field.
Step2: Create a query like below shown:
In the value of State, just input the states which represent the work done in your project. For me, there has 2 states can represent the work has been done: Done and Closed. For Assign to, you could specify the group(s) name which cover the all person you want to check in value blank.
Step3: Download this into CSV by using the button Export to CSV:
Steps4: The above step would generate a excel in local. Then you could apply the Pivot table into that to count the effort by
person.
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.
For PowerApps, what data source, other than SharePoint lists are accessible via Powershell?
There are actually two issues that I am dealing with. The first is dynamic updating and the second is the 500 item limit that SharePoint lists are subject to.
I need to dynamically update my data source, which I am currently doing with PowerShell. My data source is not static and updating records by hand is time-consuming and error prone. The driving force behind my question is that the SharePoint list view threshold is 5,000 records however you are limited to 500 visible and searchable records when using SharePoint lists in the Gallery View and my data source contains greater than 500 but less than 1000 records. If you have any items beyond the 500th record that should match the filter criteria, they will not be found. So SharePoint lists are not optional for me until that limitation is remediated
Reference: https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/
To your first question, Powershell can be used for almost anything on the Microsoft stack. You could use SQL server, Dynamics 365, SP, Azure, and in the future there will be an SDK for the Common Data Service. There are a lot of connectors, and Powershell can work with a good majority of them.
Take note that working with these data structures through Powershell is independent from Powerapps. Powerapps just takes the data that the data connector gives it, and if you have something updating the data in the background (Powershell, cron job, etc.), In order to get a dynamic list of items, you can use a Timer control and a Refresh function on your data source to update the list every ~5-20 seconds.
To your second question about SharePoint, there is an article that came out around the time you asked this regarding working with large lists. I wouldn't say it completely solves your question, but this article seems to state using the "Filter" function on basic column types would possibly work for you:
...if you’d like to filter the set of items that you are showing in the gallery control, you will make use of a “Filter” expression, rather than the “Search” expression, which is the default that existing apps used. With our changes, SharePoint connector now supports “equals” type of queries on columns that support filtering (Single line of text, choice, numbers, dates and people), so make sure that the columns and the expressions you use are supported and watch for the same warning to avoid reverting back to the top 500 items.
It also notes that if you want to pull from a list larger than the 5k threshold, you would need to use indexes, I have not fully tested this yet but it seems that this could potentially solve your problem.