How can we add autotext (user name, timestamp) to entries in a mutliline text field in Azure Devops? - azure-devops

For multiline text fields in Azure DevOps work items, is it possible to add functionality that inserts the user name and a timestamp? Our old work tracking solution had a button labeled Stamp that performed this function but the lack of it in DevOps is causing some workflow and auditing issues. The information we need is part of the History for each work item, unfortunately it is not queryable data.
Something like this:
DeveloperLuke # 12/20/2018 9:01 AM
Solution XYZ deployed to ABC.Dev01
InfraLeia # 12/20/2018 10:35 AM
Solution XYZ failed to deploy to DEF.QA01 with error "Resource not responding. A34". Currently investigating.

Related

how to copy a dashboard in a different azure devops instance?

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.

Is it possible to migrate work item from different tenants

I have two organizations in Azure Devops, with different tenants, one in "#xpto" and the other in "#abcd", is it possible to migrate boards, work items, pipelines, repos from "#xpto" to "#abcd"?
I believe that in work items there may be a problem with those that are already directed to someone, as they are
different tenants, eg "marie#xpto.com" with "marie#abcd.com"
For work items, you could export work items to CSV from org "#xpto" by query and delete the ID value column (Work item ID value is unique in each organizations)
After importing, you need the resolve the area path and assigned user issues. Check this link to check the error example: https://learn.microsoft.com/en-us/azure/devops/boards/queries/import-work-items-from-csv?view=azure-devops#import-new-work-items
For Private project repos, paste the URL and the PAT created from "#xpto" and import into "#abcd"
For pipelines, export the pipeline to JSON or YAML and Import to "#abcd". Pay attention to the resources the imported pipeline relies on(e.g. agent pool, service connection, Azure resource), you need to re-configure them.

Extract work items to an excel with more fields added to it

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

Is there a way to extract all the work items affected of a risk in Rally using REST API?

We have been using Power Bi to access our Rally backlog (Features, User stories). We are planning on including risks and milestones to the extract. We are currently able to successfully retrieve the risks and milestones but not the work items affected by them. Example is Risk RI000 that affects user stories US00000 and US00001.
We want retrieve the 2 work work items affected (US00000, US00001) along with the risk (RI000).
Rally stores WorkAffectedItems as a JSON Web file. From Risks, pull the "WorkItemsAffected.ref" column and you can convert it to a JSON record.
Table.AddColumn(#"PREVIOUS STEP", "WorkItemsAffected", each Json.Document(Web.Contents([WorkItemsAffected._ref])))
You'll then be able to expand the column like you would a normal Record to drilldown to the Formatted ID or whatever you need.

Getting user/users details based on user name/alias as parameter in azure devops

I've a tool(web application) which creates work-items in azure devops. (skipping the unnecessary details), just like how we assign any user a particular work-item from the Assigned To dropdown in azure devops, I too have a dropdown which when user enters any name/alias, a list of users starts showing based on the input.
The api which I was using in the backend was
https://abcorganization.vsaex.visualstudio.com/_apis/UserEntitlements?top=10&filter=name+eq+%27Tejas
Here filter=name+eq+%27Tejas in the query parameter helps to query the api and used to give set of users whose name starts with Tejas. It can be email alias too.
But for some reason, that doesn't work anymore. My guess, they've deprecated that API version
So in my search to find the alternative/answer, I came across the following documentation:
(https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/users/get?view=azure-devops-rest-5.1) in which the API given is: https://vssps.dev.azure.com/abcorganization/_apis/graph/users/{userDescriptor}?api-version=5.1-preview.1
Here the userDescriptor is some sort of unique key of AAD related to a particular user. (which I certainly can't use to fulfill my purpose).
The other thing which I've tried is the below query parameters but it still didn't worked out
https://vssps.dev.azure.com/abcorganization/_apis/graph/users?subjectTypes={subjectTypes}&continuationToken={continuationToken}&api-version=5.1-preview.1
So is there anyway/api which can fullfil my purpose or is it that I'm using this new API in a wrong way or something?
Any help would be much appreciated
I believe it should be $filter in the query. You are also missing the closing quote.
(See docs for more details)
https://abcorganization.vsaex.visualstudio.com/_apis/UserEntitlements?top=10&$filter=name+eq+'Tejas'
Use this. I tested it and worked for me:
https://vsaex.dev.azure.com/{organization}/_apis/userentitlements?$filter=name+eq+%27{name}%27&api-version=6.0-preview.3
Replace {organization} and {name} as needed