15
Views
1
Comments
Rest Api Patch method to edit work item in Azure DevOps
Question

Hi folks,

I am relatively new to ODC but was given a quite urgent task: we want to use ODC to update a work item in Azure DevOps using a timer. Authentication is working and when I use the work item ID, the content type and the request body as static values in the "test" section of the REST API it is working. 

My problem is I always receive 400 bad request when triggering the Rest Api Patch via the timer.

Has anyone here tried using PATCH to edit an work item in Azure DevOps before and could maybe share an example of how to set up the Patch corrctly?

Thanks a lot in advance!!

Best regards,

Lukas

2021-10-09 07-57-44
Stefan Weber
 
MVP

Hi Lukas,

a 400 bad request is most likely due to a malformed request of your request structure. The challenge with patch structures and its value attribute is that you can either target a single value path or an object path. I would assume you target an object path with multiple attributes below that path. You should inspect that sub structure, especially the "send default value" setting. There is a chance that you are simply sending an empty attribute or and attribute with the wrong data type.

But it is impossible to tell without seeing your request structures. If you have the chance to upload your OML I can take a look at it.

Best

Stefan

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.