cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BGBrownLA
Regular Visitor

Adding Tags to DevOps work items

I get an error in my workflow when Updating a Azure DevOps work item. I'm trying to add a tag value to the work item and I get the following error message:

Unable to process template language expressions in action 'Update_a_work_item' inputs at line '1' and column '2715': 'Unable to evaluate template language expression '@triggerBody()?['fields']?['System_Tags']' as JSON property name: the expression value of type 'Null' could not be used as property name.'.

 

I'm using the Other Fields and entering Dynamic Content Tags in the key field and text in the value field.

 

The peek Code shows the following for the tag info:

            "userEnteredFields": {
                "@triggerBody()?['fields']?['System_Tags']"
 
If I use the DevOps Create Work Item, I can add a tag just fine. The peek code shows:
            "dynamicFields": {
                "System.State""@body('Update_a_work_item')?
 
As you can see, the add work item is using a different name (dynamicFields) for the tags field and the update is using (userEnteredFields).
 
Is there a fix for this?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @BGBrownLA,

 

The Update work item is not supported update tags in a work item in Power Auto automate.

But you could use Send an HTTP request to Azure DevOps to do it, there is the API of add tag:

Method: Patch

URI: _apis/wit/workitems/{ID}?api-version=5.1

Header: Content-Type: application/json-patch+json

Body:

[
  {
    "op": "add",
    "path": "/fields/System.Tags",
    "value": "Tag1; Tag2"
  }
]

Annotation 2020-04-28 160634.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-litu-msft
Community Support
Community Support

Hi @BGBrownLA,

 

The Update work item is not supported update tags in a work item in Power Auto automate.

But you could use Send an HTTP request to Azure DevOps to do it, there is the API of add tag:

Method: Patch

URI: _apis/wit/workitems/{ID}?api-version=5.1

Header: Content-Type: application/json-patch+json

Body:

[
  {
    "op": "add",
    "path": "/fields/System.Tags",
    "value": "Tag1; Tag2"
  }
]

Annotation 2020-04-28 160634.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks, this worked for me. I noticed though that the new tag wipes out the existing tags in the work item. Is there a way to just add the new tag and not remove the old tags?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,558)