Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Azure Devops Connector - Create Work Item for Unassigned

(0) ShareShare
ReportReport
Posted on by 12

Hello,

 

My creating a flow which grabs values off of a SharePoint (coming from PowerApps) and creating an work item in Azure DevOps. When I use "Create a work item (Azure DevOps)". Even though I leave the "Assigned To" (under Show Advanced Options) it assigns the task to me.

Gone through this thread: Solved: Re: Azure Devops Connector - Create Work Item for ... - Power Platform Community (microsoft.com)

I have to added "Send a HTTP request to Azure DevOps" after "Create a work item (Azure DevOps)" with the following:
Relative URI: {Project name}/_apis/wit/workitems/$issue?api-version=7.1-preview.3
Headers: Content-Type: application/json-patch+json
Body:
{
"op":"add",
"path":"/fields/System.AssignedTo",
"from":null,
"value":""
}

The error I get is:

"status"400,
  "message""You must pass a valid patch document in the body of the request.
Details: {\"$id\":\"1\",\"innerException\":null,\"message\":\"You must pass a valid patch document in the body of the request.\",\"typeName\":\"Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, Microsoft.VisualStudio.Services.Common\",\"typeKey\":\"VssPropertyValidationException\",\"errorCode\":0,\"eventId\":3000}"
,
  "error": {
    "message""You must pass a valid patch document in the body of the request.\
Details: {\"$id\":\"1\",\"innerException\":null,\"message\":\"You must pass a valid patch document in the body of the request.\",\"typeName\":\"Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, Microsoft.VisualStudio.Services.Common\",\"typeKey\":\"VssPropertyValidationException\",\"errorCode\":0,\"eventId\":3000}"
  },
  "source""vsts-ce.azconn-ce-001.p.azurewebsites.net"
}



I want to create a work item with the following:
Type: Issue
Description field should have the following data from SharePoint: (Priority, Created By, Email)
Link URL: URL column from SharePoint
Assigned To: null
State: New

  • mnshah Profile Picture
    12 on at
    Re: Azure Devops Connector - Create Work Item for Unassigned

    This is what I have now:
    [
    {
    "op": "add",
    "path": "/fields/System.Title",
    "from": null,
    "value": "sample"
    },
    {
    "op": "add",
    "path": "/fields/System.AssignedTo",
    "from": null,
    "value": ""
    },
    {
    "op": "add",
    "path": "/fields/System.Description",
    "from": null,
    "value": "Description: unassigned"
    },
    {
    "op": "add",
    "path": "/fields/System.Link URL",
    "from": null,
    "value": "bi assigned"
    }
    ]

    and the error message now:

    {
      "status"400,
      "message""You must pass a valid patch document in the body of the request.
    Details: {\"$id\":\"1\",\"innerException\":null,\"message\":\"You must pass a valid patch document in the body of the request.\",\"typeName\":\"Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, Microsoft.VisualStudio.Services.Common\",\"typeKey\":\"VssPropertyValidationException\",\"errorCode\":0,
      "error": {
        "message""You must pass a valid patch document in the body of the request.
    Details: {\"$id\":\"1\",\"innerException\":null,\"message\":\"You must pass a valid patch document in the body of the request.\",\"typeName\":\"Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, Microsoft.VisualStudio.Services.Common\",\"typeKey\":\"VssPropertyValidationException\",\"errorCode\":0,\
      },
      "source""vsts-ce.azconn-ce-001.p.azurewebsites.net"
    }

    Looks like its asking ID to be mentioned. But that's autogenerated right?
  • Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: Azure Devops Connector - Create Work Item for Unassigned

    Hi @mnshah,

     

    The body seems to be missing the square brackets. Also it looks like you haven't included a Title for your work item. Afaik that property is is required to be able to save a new work item.

     

    Can you try the below as the setup with that Body payload?

     

    URI

     

    @{variables('Project')}/_apis/wit/workitems/$Issue?api-version=7.1-preview.3

     

     

    Headers

     

    {
     "Content-Type": "application/json-patch+json"
    }

     

     

    Body

     

    [
     {
     "op": "add",
     "path": "/fields/System.Title",
     "from": null,
     "value": "Sample Issue"
     },
     {
     "op": "add",
     "path": "/fields/System.AssignedTo",
     "from": null,
     "value": ""
     }
    ]

     

     

    titlerequired.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow