1
votes

I am trying to create a state for existing work item.

For Get, the url will show the list of States under Bug.

But am facing an issue when I do Post with json.

https://{server}/{collection}/_apis/work/processes/{processid}/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/states?api-version=5.0-preview.1

Json:

{"name": "Test-Status", "color": "007acc", "stateCategory": "InProgress", "order": 3 }

Below is the error details

Http - 404 - NotFound

{ "$id": "1", "innerException": null, "message": "VS402805: Cannot find work item type with reference name 'Microsoft.VSTS.WorkItemTypes.Bug' in process named 'dcdcc713-ebc6-4940-aa9d-d6c9d3e00e39'.", "typeName": "Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.ProcessWorkItemTypeDoesNotExistException, Microsoft.TeamFoundation.WorkItemTracking.Server", "typeKey": "ProcessWorkItemTypeDoesNotExistException", "errorCode": 0, "eventId": 3200 }

Any help regarding this is appreciated.

1

1 Answers

2
votes

The problem should be:Microsoft.VSTS.WorkItemTypes.Bug. I think you need use the format like processName.typeName. In addition the original process cannot be customized , only the inherited process can be customized.

Here I test your api in postman,it can work well. enter image description here