How do I Copy Task Groups in Visual Studio Online?
Asked Answered
T

3

6

Task Groups are a great way to build a library of commonly executed Build and/or Deployment Actions in Visual Studio Online. Does anyone know of a way to make a copy of (or clone) an existing Task group? I don't see that as an option in the UI anywhere.

Talky answered 1/2, 2017 at 21:21 Comment(0)
C
10

I think there is no way to do this yet. It's not even possible on TFS On-premise. Though our TFS professional told us, it should come with TFS2017 Update 1.

Only thing you can do, is select all tasks in your task group and create a new TaskGroup with them. Which is basically the same as cloning the task group itself - it only takes you some clicks more.

Chrismatory answered 2/2, 2017 at 7:43 Comment(2)
Great! I completely missed that I coud create a Task Group from within a Task Group. Very meta...Talky
One thing to note with this approach is that it technically updates the task group you are "cloning" to use the new task group instead of its original tasks. However, you can simply choose to not save at that point and you are good to go. Maybe this was obvious, but a coworker had to point that out to me, so I thought it might be helpful.Bridgeboard
S
7

Or you could export your task group, change its name and Id in the exported Json, and import it.

Sable answered 18/7, 2017 at 9:54 Comment(2)
This appears to be the documented solution according to Microsoft: "Use this feature to transfer task groups between projects and enterprises, or replicate and save copies of your task groups." (learn.microsoft.com/en-us/azure/devops/pipelines/library/…).Consumer
To be more precise: 1. Export the task group. 2. Import the task group. 3. Rename the new task group in Azure. 4. Click save.Gest
N
1

Currently there isn't the copy Task Group feature in VSTS and TFS.

You can create TaskGroups according to your requirement and manage them from TaskGroups tab, then use them directly in different scenario. Please follow below steps.

  1. Create a Task Group from Build/Release definition
  2. Navigate to Build&Release > Task Groups
  3. Select the Task Group you need to modify, change the Properties/Tasks
  4. Save the Task Group

If you just want to copy the Task Groups, you can install the "Copy Build Steps" extension. it can copy build/release steps from one definition to another, also support copy the Task Group.
After installing the extension, navigate to the Builds hub > All definitions. A new menu item, ‘Copy build steps’ will be available when you click the ‘’…’’ behind the definition.

To Use a task group: In a build/release definition, choose Add steps/tasks to open in the Task catalog. Select the category you specified for your task group and find the task group (it displays the name and description you specified when you created it), then choose Add - just as you would with any other task. enter image description here enter image description here

Northwards answered 2/2, 2017 at 8:16 Comment(1)
Great info but I'm awarding the answer to phifi as that solution doesn't require an extension and will works the same way for both Builds and Releases.Talky

© 2022 - 2024 — McMap. All rights reserved.