1

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.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Uday
  • 151
  • 1
  • 3
  • 15

2 Answers2

2

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

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
0

I had the same problem.

When you create a new process, all the Work Item Types from the Parente process (Agile, Scrum, etc.) starts with the Microsoft.VSTS.WorkItemTypes.(Epic, Bug, etc.) and you can't modify it, you will have the error:

"VS402805: Cannot find work item type with reference name 'Microsoft.VSTS.WorkItemTypes.Bug' in process name ..."

To solve this, you just need to create a new work item type that inherits that work item type that you want to use, post example:

POST https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workitemtypes?api-version=6.0-preview.2

{

  "referenceName": "ProcessName.Issue",

  "name": "Issue",

  "description": "your description",

  "color": "B4009E",

  "icon": "icon_traffic_cone",

  "inheritsFrom": "Microsoft.VSTS.WorkItemTypes.Issue"

}

I hope it helps.

Have a nice day!