MicrosoftDocs / vsts-rest-api-specs

MIT License
169 stars 116 forks source link

Mistake in "Add a link" example #704

Open potatojaisiladki opened 5 months ago

potatojaisiladki commented 5 months ago

While trying out the example for updating the example for "Add a link", Failing body:

$body = @(@(
            [ordered]@{
              op = 'add'
              path = '/relations/-'
              value = @{
                   rel = 'System.LinkTypes.Related'
                   url =  "$url_value"
                   attributes = @{
                      comment = "Linking the workitem"
                    }  
              }
       }
      [ordered] @{
        op = 'add'
        path = '/fields/System.Tags'
        value = "devops"
      }  

Error: error=;{"$id":"1","innerException":null,"message":"Value {\r\n \"url\": \"https://dev.azure.com/organization/project/_apis/wit/workItems/2206\",\r\n \"attributes\": \"System.Collections.Hashtable\",\r\n \"rel\": \"System.LinkTypes.Related\"\r\n} does not match the expected type Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItemRelation.","typeName":"Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, Microsoft.VisualStudio.Services.Common","typeKey":"VssPropertyValidationException","errorCode":0,"eventId":3000}

Working body: $body = @(@(

[ordered]@{
    op = 'add'
    path = '/relations/-'
    value = @{
      rel = 'System.LinkTypes.Related'
      url =  "$url_value"
    }
  }
  [ordered] @{
    op = 'add'
    path = '/fields/System.Tags'
    value = "devops"
  }  

image

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.