Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistake in "Add a link" example #704

Open
potatojaisiladki opened this issue Jun 25, 2024 · 0 comments
Open

Mistake in "Add a link" example #704

potatojaisiladki opened this issue Jun 25, 2024 · 0 comments

Comments

@potatojaisiladki
Copy link

potatojaisiladki commented Jun 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant