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.
-
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 Answers
I tried different options and no luck. So the workaround was

- 1,006
- 9
- 24
-
1Seems 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
-
1This 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
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.

- 151
- 1
- 9
You might find helpful Tags Manager extension, it is available freely in VS marketplace
-
1This 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
I found a way to do this using the CSV import feature.
- In DevOps, under Boards > Work Items, filter by the Tag you want to change
- Click "Open filtered view in Queries"
- Click "Export to CSV" (you may have to click the three dots to see this option)
- Open the file in Excel
- Find and replace every instance of the tag with the correct spelling and save
- In DevOps, Go to the Boards > Queries page click "Import Work Items"
- Choose the file and click "Import"
- Click "Save Items"
Since the downloaded file contains the ID column, the tags will be updated on the existsing work items.

- 1
- 2
I did below and worked:
- Click on Create Tag.
- Give the new Name of tag. (in above case it is "A B")
- In field "Tag From" select wrong tag. (in above case it is "AB")
- Provide Description and click Create.
- Now delete the wrong named Tag. (in above case "AB")
Thats it, done.

- 1
- 2
-
2
-
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