pagerduty-cli icon indicating copy to clipboard operation
pagerduty-cli copied to clipboard

Add/Remove Tags from a Resource

Open n8price opened this issue 3 years ago • 3 comments

It would be great to have the ability to remove a tag from all connected entities or add a tag to an entity. Ideally I would love to be able to pipe a list of team resource ids to set or remove a tag.

n8price avatar Apr 27 '22 20:04 n8price

Hi @n8price it makes sense. I have added some tag commands to v0.1.3 that I would like you to check out. If you have a self-updatable installation of pd, you can do pd update rc to get it; if you installed using npm, something like npm i -g [email protected] should do the trick. The commands are tag:list, tag:assign and tag:listobjects. Tag:assign can add/remove multiple tags from multiple entities of multiple types in one go. It's not yet amenable to pipes but what I will do if this functionality seems complete enough is add some shim commands to user, ep, team, like user:tag:add etc. that will take pipes and call tag:assign with proper argument lists. Let me know what you think... Thanks!

martindstone avatar May 19 '22 15:05 martindstone

Hey this is wonderful! Thanks so much. I'll check it out. Sorry for the delay in reply.

n8price avatar Sep 09 '22 22:09 n8price

This works great! Would love the shim command like team:tag:add or team:tag:remove 🥇

n8price avatar Sep 16 '22 21:09 n8price