Tag-Governance not evaluating all the key pairs

Camila Godoy
Tera Expert

Hi Everyone - I am using tag governance to evaluate if a configuration item has a valid key pair.

I am comparing if it is valid using a script. For my tag key & value policy 
the key is X and the value would be a script such:

 

var tagValues = [];
var gr = new GlideRecord('cmdb_ci_business_app');
gr.addEncodedQuery("active=true");
gr.query();
while(gr.next()){
   tagValues.push(gr.number + '');
}

 

 
The issue I encounter is when a configuration item has more than one tag. It is not evaluating all the possible tags.

For example:
Server1 has the following key pairs-> X - 00000 and X - 11111
The evaluation is finding the first key value pair and determining if it failed or passes the rules.

However, we need to make sure we have all possible tags evaluated.
X - 00000 Pass
X - 11111 Failed

Rather than X - 00000 Pass
Why is this not working? Would you know of anything that could change this?

Thank you!

13 REPLIES 13

Ram Devanathan1
ServiceNow Employee
ServiceNow Employee

tag governance will check against only 1..

 

It is not supported to have 2 tag entries, with same key and different values. cloud providers do not allow this - see screenshots below.

can you please share the use-case where you see a need for this?

 

RamDevanathan1_0-1669800294687.png

 

Hello Ram - we were hoping to use this for our service mapping tags that include on-prem configuration items. A lot of on-prem configuration items would be shared resources between applications.

Example:
Server1 - app_number - 10000
Server1 - app_number - 10001
Server1 - app_number - 10002

We were expecting that the solution would include option to evaluate all the resources. I believe at some point it was working but I could be wrong. Is there any work around for this?

Thank you!
Camila

ok i get it - is this because it is a resource shared between these various Applications?

 

the problem with something like this is - we cannot differentiate good and bad scenarios very easily.

if a CI has a tag environment=test, as well as another key-value record environment=prod (which got inadvertently added), the CI will meet both cases - which does not make sense as one CI should not be in both test and prod environments at same time.

 

Ram

Yes - some servers are used by more than one application. The way we are evaluating right and wrong is by using scripts to compare with a set of values.

With the Environment example you gave, this is the reason we should be able to evaluate more than one value. 

Server1 - Correct environment is Prod
It has two tags to it: environment - Prod and environment - Test
When it runs, the first key value it finds is "environment - prod" and the tool thinks it is right and approves it. However, it still have a test tag that is wrong. We should be able to fid what is wrong.

changing environment value to a application and find the situation we have. we are not able to find wrong tags when it finds the right one first. 

Please let me know if you think I should make a case out of this topic.
Thank you!
Camila