Create TFS Work Item using Azure Dev Ops with OAuth 2.0

Sasmal, Virender Kumar 1 Reputation point
2022-06-22T19:15:14.567+00:00

Hi All,

I am trying to create work items into TFS using Azure Dev Ops REST API. I am trying in two ways.

  1. PAT - Works fine
  2. 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.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,053 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-06-22T19:16:17.327+00:00

    Devops / TFS is not currently supported here on Q&A. The product group for Azure DevOps / TFS actively monitors questions over at
    https://developercommunity.visualstudio.com/report?space=21&entry=problem
    https://developercommunity.visualstudio.com/report?space=22&entry=problem
    https://azure.microsoft.com/en-in/support/devops/

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.