Home > Enterprise >  Create Azure DevOps task with description
Create Azure DevOps task with description

Time:04-13

I'd like to open a Bug using the Azure DevOps REST API and create it with a description. I couldn't find in the docs how to do it, I've only seen something about the title. I've been trying to create a bug with a description by sending this body on the request:

[
  {
    "op": "add",
    "path": "/fields/System.Title",
    "from": null,
    "value": "Sample task"
  },
  {
       "op": "add",
        "path": "/fields/System.Description",
        "from": null,
        "value": "Test of REST functionality"
  }
]

But still no success...

CodePudding user response:

The work item type Bug does not have the field Description. Instead, it has the field called Steps to Reproduce, which is probably what you're trying to set.

So, first of all you need to specify the type URI parameter to be a Bug, and change the payload to something like the following:

[
  {
    "op": "add",
    "path": "/fields/System.Title",
    "from": null,
    "value": "Sample task"
  },
  {
    "op": "add",
    "path": "/fields/Microsoft.VSTS.TCM.ReproSteps",
    "from": null,
    "value": "Test of REST functionality"
  }
]

I can't verify this to be 100% sure at the moment but hope this gives you enough information to try it out.

  • Related