Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

How to remove tags from work items in Azure Devops

(1) ShareShare
ReportReport
Posted on by

Removing tags from work items should be straight forward using the "update a work item" operation, which lets you choose to Append, Replace, or Remove tags. However since a week or so, this functionality is broken. I've posted about it here.

 

How or why "premium" functions in PowerAutomate can suddenly get borked for more than a week withour fixing and what that means for your business continuity, is perhaps a discussion for another day. I've been in touch with the Azure Devops devs and it seems that the API works fine, so I've tried to create a workaround using the "send an HTTP request to Azure Devops" operation, which I'm sharing here.

 

The problem with HTTP requests is that all tags in a work item form a single string. You can add an extra tag easily, but you can't remove them. You can only remove the entire string, thereby removing all tags.

So the strategy is:

  1. get the string with all the current tags
  2. split it up and filter out the tags to be removed
  3. Build a new string with the remaining tags
  4. Remove all the tags from the work item
  5. Add the new string to the work item

In this example I'm removing tags from features that I've selected via a query.

First we initiate an empty variable (TagString) that we'll use to build up a string with all the tags that shouldn't be removed.

For each feature from the query result we get the details, so we can find the tags.

JeroenE_0-1629450836072.png

 

Now we do another "apply to each" loop named SplitTags; for the output we choose a split function:

split(outputs('Feature_Details')?['body/fields/System_Tags'],';')

The body/fields/system_tags string take the form "tag1; tag2; tag3;" so this function splits up that string into individual tags; the subsequent logic is applied to those tags individually.

We can now use a condition (Remove unwanted tags) to filter out any tags we want removed with multiple OR-statements. (In this example, MyTag and Tag1 are removed.)

If the condition is false then the tag should not be removed, so we append that tag to the TagString variable with a ';' stuck at the end, using an "append to string variable" operation.

JeroenE_1-1629451338576.png

 

All we have to do now is replace the existing body/fields/system_tags string value with the TagString value, using HTTP requests:

First remove all tags from the work item, then add the ones that need to remain, using the variable. At the end, empty the variable so that's it's ready for the next work item that needs some of its tags removed.

 

JeroenE_2-1629452571340.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,653 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