I need to get Area ID of the work item in Azure DevOps for creating custom rules in the process. Currently, I can only find Area Path of work item but for creating rules we need Area ID.
Additionally, you can add "Area ID" into the work item query columns:
You can use Classification Nodes - Get Root Nodes Rest API with $depth property to get all the area paths.
In the response you will get the Id for the Areas:
Related
I have a requirement to copy an existing dashboard dashboard in an org(source org) to a different org(target org) under a different ado instance by any means possible. Dashboard can have widgets and widgets can be linked to
pipeline
Query - A query can be referencing to a user, team, project, custom values of a standard field, custom fields
some other things that i have not encountered so far
So far my steps are as follows
get dashboard details using get dashboard rest api
identify widgets in dashboard details api response
get any pipeline if there is no pipeline create a dummy one and use its details for a widget that is using pipeline
identify distinct queries present in all widgets
create its equivalent query in target org and save its id
replace queryid in widget settings to its equivalent created queryid in targetorg
create dashboard in target org
I am facing issue in step 5
There are lot of moving variables in a query. Query might be referencing to things that does not exist in target org like a particular user, team, custom values of a standard field, custom fields. In order to create a query successfully i need to know possible values of a field in target org. While creating a new query from ui it shows possible values for a field in dropdown so i am wondering is there any rest api that gives possible values of a field and if no such field exist in target org then it should throw error.
Looking forward to suggestions for a simpler or alternative approach to replicate a dashboard across different ado instance and/or better approach for step 5
If you are looking for a rest api the query the fields in your target process of the organization, you could refer to this doc. Field-list.
GET https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/fields?api-version=6.0-preview.2
After that, you could create the fields in your target process, you could refer to this rest api. Fields-Create
POST https://dev.azure.com/{organization}/_apis/work/processdefinitions/{processId}/fields?api-version=4.1-preview.1
Or could you share more details of your requirement, like screenshots and widget definition or dashboards configuration for update.
I am extracting the list of bugs from Azure Devops using Query. I was able to extract the bugs but it was extracted only with ID, Description, work item type and assigned to fields alone. I wanted to extract the list of bugs with some more fields like closed by, created by, raised by. I have explored custom setting but I could not able to get the desired result. Let me know if this is achievable in Azure Devops please.
In Azure DevOps portal, seems you could not export them to csv with these values.
You could export them and get the work item ids, then use the REST API - Work Items - Get Work Item in a loop, the API will return the values you want.
Please refer to the sample response here - https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/get-work-item?view=azure-devops-rest-6.0#get-work-item
I am attempting to do a put on
https://team.vssps.visualstudio.com/_apis/Graph/Memberships/{aadgp.GroupDescriptor}/vssgp.{GroupDescriptor}
I can come up with the ADO group starting with vssgp. but I have been unable to come up with the AAD descriptor.
Calling AAD graph with
https://graph.microsoft.com/v1.0/groups?$filter=displayName eq 'groupName'
doesnt appear to provide me anything that looks like that and calling
https://team.visualstudio.com/_apis/IdentityPicker/Identities?api-version=6.0-preview
with body
{
"query": "groupName",
"identityTypes": ["group"],
"operationScopes": ["ims", "source"]
}
doesnt give me anything that starts with aadgp.
I am running out of ideas and was hoping one of you may have done this already. I am unable to get all of the groups that have access to the org or team project as it will likely be a new group being added.
tia
You have to make a bunch of calls.
Get Azure graph to get Guid of group
GET https://graph.microsoft.com/v1.0/groups?$filter=displayName eq ‘GroupName’
Get projects to determine id of project I need
GET https://dev.azure.com/{organization}/_apis/projects?api-version=6.0
Post to group entitlements to add the new group in
POST https://vsaex.dev.azure.com/{organization}/_apis/groupentitlements?api-version=6.0-preview.1
Get all groups from the org to get the aadgp value
GET https://vssps.dev.azure.com/{organization}/_apis/graph/groups?api-version=6.1-preview.1
Put on graph membership to add the group
PUT https://vssps.dev.azure.com/{organization}/_apis/graph/memberships/{subjectDescriptor}/{containerDescriptor}?api-version=6.0-preview.1
Delete on group entitlements to eliminate unneeded group entitlement
DELETE https://vsaex.dev.azure.com/{organization}/_apis/groupentitlements/{groupId}?api-version=6.0-preview.1
I have successfully retrieved work items from the api. I can also retrieve iterations/teams/projects etcetera from the api. My issue is that I have work item objects that I want to reference to iterations/teams/projects. I have not found a way to retrieve this info from the existing info on the work item. It appears that an iteration path doesn't always relate to a real iteration??? Are there fields in a work item that I can use to reference projects/teams/iterations.
https://learn.microsoft.com/en-us/rest/api/azure/devops/work/iterations?view=azure-devops-rest-5.1
https://learn.microsoft.com/en-us/rest/api/azure/devops/core/teams?view=azure-devops-rest-5.1
https://learn.microsoft.com/en-us/rest/api/azure/devops/core/projects?view=azure-devops-rest-5.1
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items?view=azure-devops-rest-5.1
the missing element was getting iterations from this api:
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/classification%20nodes/get?view=azure-devops-rest-5.1
and traversing the iteration path up and down and giving it a $depth to get children
Azure DevOps allows to link work items with commits, build and releases. It works, and I can see all those links in a work item form. But is there a way to query work items using those links? I.e. query WIs associated with any or particular commit(s)/build(s)/release(s).
All I could find so far is to query WIs by count of external links and view a simple list of associated WIs from a particular build.
You can not query work items using Artifact Links in UI. But you can use Artifact Uri Query - Query API to query work items linked to a given list of artifact URI. For example:
POST https://dev.azure.com/{organization}/{project}/_apis/wit/artifacturiquery?api-version=5.1-preview.1
{
"artifactUris": [
"vstfs:///Build/Build/1566"
]
}