0
votes

I accidentally deleted a Task Group but I need it and I would like to restore it.

Is there any way that a deleted Task Group could be restored in Azure DevOps (VSTS)?

I see in the documentation that deleted Build Definitions can be restored but I found nothing about deleted Task Groups.

2
Hi, how the things going? Does the below answer could help you achieve what you want? If yes, you can accept the answer thus other SO users will be able to see whether the solution works. If you still facing some issues, feel free to leave commend here :-)Frank Wang-MSFT
@FrankWang-MSFT is there a way to do this if YAML wasn't used?MuKa

2 Answers

2
votes

There is certainly a workaround to restore the task group, and that is creating an identical one and replacing all the references to point to the newly created task group.

For that, first you need the GUID of the deleted task group. You can get it easily from a pipeline referencing it: missingTaskGroup

Just go to the history tab of the given pipeline and look for the deleted task group and its GUID in the YAML after opening one of the versions using "Compare Difference".

You should find something like this, where id is the GUID of the task group:

"steps": [
      {
        "environment": {},
        "enabled": true,
        "continueOnError": true,
        "alwaysRun": true,
        "displayName": "Task group: testTaskGroup ",
        "timeoutInMinutes": 0,
        "condition": "succeededOrFailed()",
        "task": {
          "id": "5e417q45-afea-4f74-a126-a26ea17020dc",
          "versionSpec": "1.*",
          "definitionType": "metaTask"
        },
        "inputs": {}
      }

Replacing the placeholders in the following URL and navigating to it should let you retrieve the full history of the deleted task group: https://dev.azure.com/[yourOrganization]/[yourProject]/_taskgroup/[taskGroupGuid]

After switching to the History tab, you can just save the JSON of the version you prefer and use the Import feature in the Taskgroups page to create a new, but identical task group as the deleted one.

0
votes

Please be aware that currently the suggested answer no longer works. After deleteing a taksgroup and hitting the URL the history tab yields nothing, and the export feature does not work.

Based on the documentation below, there is no restore method.

https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/taskgroups?view=azure-devops-rest-5.1