20

We have a large instance of Visual Studio Online or VSTS or Azure DevOps. We have a Tag on work items that is called "A B" for example. Someone also created another tag "AB". I want to just rename the tag "A B" to "Don't use A B" or just delete the tag if possible. Is there an API I could use to do this? I checked out the TAGHelper add-in but because we have many tags, the tag helper add-in is just unusable. I can write a simple tool if needed, but wondering if there is a quick way to do this.

riQQ
  • 9,878
  • 7
  • 49
  • 66
dgorti
  • 1,130
  • 2
  • 12
  • 22
  • Feel free to vote for the [enhancement request](https://developercommunity.visualstudio.com/t/Ability-to-rename-a-tag-that-is-in-use/1352315) – Rowland Shaw Mar 01 '21 at 15:04

5 Answers5

23

I tried different options and no luck. So the workaround was

  • Filter the tasks in the backlog by the tag
  • Selected all of them (do this in backlog view, not board view)
  • Right Click -> Edit
  • Tag(remove) the tag I don't want
  • Tag(add) the tag I want enter image description here
nilan59
  • 1,006
  • 9
  • 24
  • 1
    Seems you have to have at least one item with the new name already used. Seems you can't enter a new name in that editor. – Noein Jan 05 '20 at 14:45
  • 1
    This solved my problem as well. Note that for me, the right-click context menu was not shown. So instead, I clicked on the three dots of one of the selected items, to the right of the *Title* column, and selected **Edit**. Then the *Edit work items* dialog was shown. – MC Emperor Jul 22 '21 at 07:54
12

Sadly, you can't delete it directly, only create a new one and unassign all the old usages.

From the documentation

You can't delete a tag itself. However, if you delete a tag from all work items to which it's currently assigned, the system will delete the tag. The system automatically deletes unassigned tags after 3 days of disuse.

If you misspell a tag, don't assign the misspelled tag to any work item and the system will automatically delete it within 3 days.

dreadcrumb
  • 151
  • 1
  • 9
8

You might find helpful Tags Manager extension, it is available freely in VS marketplace

Ruli
  • 2,592
  • 12
  • 30
  • 40
Colin B
  • 306
  • 1
  • 7
  • 1
    This won't work for me because it requires admin permissions to install the extension. I am looking for may be some API sample that I could run – dgorti Nov 29 '18 at 01:31
0

I found a way to do this using the CSV import feature.

  1. In DevOps, under Boards > Work Items, filter by the Tag you want to change
  2. Click "Open filtered view in Queries"
  3. Click "Export to CSV" (you may have to click the three dots to see this option)
  4. Open the file in Excel
  5. Find and replace every instance of the tag with the correct spelling and save
  6. In DevOps, Go to the Boards > Queries page click "Import Work Items"
  7. Choose the file and click "Import"
  8. Click "Save Items"

Since the downloaded file contains the ID column, the tags will be updated on the existsing work items.

-1

I did below and worked:

  1. Click on Create Tag.
  2. Give the new Name of tag. (in above case it is "A B")
  3. In field "Tag From" select wrong tag. (in above case it is "AB")
  4. Provide Description and click Create.
  5. Now delete the wrong named Tag. (in above case "AB")

Thats it, done.

Jeet
  • 1
  • 2
  • 2
    Where is the "Create Tag" button/link? – knighter Oct 14 '20 at 20:25
  • Here you are referring to the REPO "Tags" - which is NOT the same as the tags you place on the Work Items. The "Create Tag" menu item is under Repo->Tags, but again that is NOT what this question refers to, thanks for your answer but maybe preface it with the differentiator. – Davemundo Sep 02 '22 at 21:45