Hi All,
I am trying to create work items into TFS using Azure Dev Ops REST API. I am trying in two ways.
- PAT - Works fine
- OAuth - Issue
What am I doing -
Create an app on azure portal.azure.com and added azure devops as API permissions to the app. I am using the API and able to generate the access token. Now I am trying to use that access token and create work item in TFS but it is failing with below error -
Error
The page you are looking for is currently unavailable.
TF400813: Resource not available for anonymous access. Client authentication required.
I checked IIS on TFS server and it is set as Anonymous Authentication enabled.
I am trying to do this with Postman.
To generate token I passed - OAuth Token URL , Client ID, Client Secret and able to get the access token.
This is TFS Url which I am using further to create work item in TFS using access token.
https://<<domain>>/<<org>>/<<project>>/_apis/wit/workitems/$Change Request?api-version=6.0 (tried with api version 5.0 and 5.1 - no luck)
Body -
[
{
"op": "add",
"path": "/fields/System.Title",
"value": "Test OAuth"
},
{
"op": "add",
"path": "/fields/Custom.BusinessArea",
"value": "Underwriting"
},
{
"op": "add",
"path": "/fields/Endurance.SDLC.Priority",
"value": "4-Low"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.Common.Severity",
"value": "4-Low"
}
]
Please help.