Reputation: 11
Power Automate flow to update a workitem with a custom ID for particular work item type. E.g. we have workitem type 'Activity' and if a user creates a new workitem Activity then update the field 'custom ID' as 'Activity - 1' then the next time a user created new workitem Activity then update the field 'custom ID' as 'Activity - 2' and so on. appreciate any kind of help.
tried below flow but it gives an error and not sure how to get the serial number.
. Also I dont find the custom field 'Custom ID' in the 'update work item' action.
new error while trying to run the flow:
Upvotes: 1
Views: 4933
Reputation: 5296
To update a work item with a custom ID for particular work item type, you can refer to the followings.
Step1: Use action "When a work item is created"
Step2: Use action "Get work item details"
Work Item Id is get from Step1.
This action uses REST API Work Items - Update to update work item field.
URL: https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.0
Headers: Key: Content-Type
Value: application/json-patch+json
Body:
[
{
"op": "add",
"path": "/fields/Custom.customID",
"value": "Activity - 1"
}
]
Authentication: Basic
Username: Your user name in Azure DevOps. You can check from User settings.
Password: Personal Access Token created in Azure DevOps.
Then when I create a new Activity, the custom ID will be "Activity - 1".
Upvotes: -1