Does azure devops support the retrieval of data from rest API and populate that data in the workitem fields
I tried writing powershell script to retrieve data from rest API and populate that data in workitem fields in azure devops
Does azure devops support the retrieval of data from rest API and populate that data in the workitem fields
I tried writing powershell script to retrieve data from rest API and populate that data in workitem fields in azure devops
2
Answers
Yes, you can get the fields of
workItems
by calling the API below: –GET API: –
Reference1
And update the Fields by calling the API below: –
Update API:-
Reference2
There’s one more API to update a particular field in WorkItem
Reference3 :-
After you retrieve the value from 3rd party rest api, you can
parse
the response to get the value wanted, thenset
the value to thefield value
in rest api below to update the work item.The
$fieldvalue
is gotten from your 3rd party rest api as an example. The reference doc: Update a field.Please make sure your account (which generated the PAT) has
enough permission
to edit the boards work item, you can simply set the account ascontributor
rule of the DevOps project.To
dynamically
retrieve value from 3rd party rest api, you can consider to use DevOps pipeline, and could have options below:You could need to monitor the change of the 3rd party rest api somehow, it depends on your 3rd party rest api, and then trigger devops pipeline, in pipeline you can get the value and update the work item value.
Or you can set schedule trigger on DevOps pipeline, so that the pipeline will automatically run in schedule to update the work item.