REST API - Add tags to a tagset - Octopus.Client.dll

integration

(Lucio Falco) #1

Hello there,
I am trying to use Powershell to automate the creation of new environments/target machines and so tags mapped to the single tagset (in my scenario).
I have tried using Octopus.Client.dll. I can export the tagset with all the Tags, but I don’t know how to create a new tag and map to it. (I need probably to modify the existing tagset with the new tag in the instruction)…
Thank you for your help.
I am going insane :smiley:
Regards.
L.


(Dalmiro Grañas) #2

Hi Lucio,

Deep apologies for the terrible delay here! Somehow this thread slipped through the cracks of our support process :(. Hope you are still sane!

Give this script a try and let me know how it goes: https://github.com/OctopusDeploy/OctopusDeploy-Api/blob/master/Octopus.Client/PowerShell/Tagsets/AddTagToTagset.ps1

Cheers!
Dalmiro


(Lucio Falco) #3

Hi Dalmiro,
thanks for your reply.
I tried the instructions provided, and now I have the new tag in the $tagset.tags list, but if I check on the webpage I cannot find the created tag in the tagset.
PS: I have filled all the fields (apart the description).
Thank you for your time.
Regards.
L.


(Dalmiro Grañas) #4

Hi Lucio,

Can you believe I forgot to add the line that saves the changes to the TagSet?

I just added it in github :). Go back to that same link and grab the latest version.

Sorry about that!

Cheers


(Lucio Falco) #5

Hi Dalmiro.
It’s perfect. Thank you indeed.
Regards.
L.


(system) #6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.