AnsweredAssumed Answered

Groovy tag on static parent tag not getting children

Question asked by Ben Kettlewell on Dec 15, 2015
Latest reply on Oct 9, 2017 by Robert Klohr

My setup:

Networking - Static Parent

Firewall - Dynamic children

Routers

Switches

etc.

Servers - Static Parent

WindowsServer2012 - Dynamic children

Linux

etc.

Printer - Static Parent

Dynamic types of printers - you get the idea

 

I want to make a groovy script that gets the exclusive set of Networking, Servers and Printers. I wrote the below which should work but for some reason it's not getting the children of the tags. If I do make it specific to each individual child tag (e.g. !asset.hasTag("Firewall") && !asset.hasTag("Routers") && etc.) it works but that opens it up to being ruined by even minor changes and additions.

 

if(asset.getAssetType()!=Asset.AssetType.HOST) return false;

return !asset.hasTag("Networking") && !asset.hasTag("Printer") && !asset.hasTag("Servers");

 

Thanks for any ideas

Outcomes