Tag-Governance not evaluating all the key pairs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 07:39 PM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 08:24 PM - edited 11-30-2022 08:42 PM
Hi, thanks for the clarifications. Here's my summary of the problem and the ask from ServiceNow.
Problem: multiple tag-values are assigned to a key for the same CI and some values may be wrong.
Required solution: identify the tag values that are wrong and provide a way to remove or correct these tags.
i would recommend raising an idea in the ideas portal for this since this is an enhancement request.
1. as mentioned earlier, same CI having multiple tag values for a key, is not a scenario that we support till date
2. as a remediation, there's a need to remove the wrong values - this requires an additional remediation action (remove tag value record) which we do not support till date
With sufficient upvotes for the idea we will take it up into the product in coming release.
in the meantime when i get some time, i will get across a simple code-fix for the point 1. above - at least this will surface the wrong values to you.
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 06:11 AM
@Ram Devanathan1 I have the idea created here.
Do you need me to create a Request on Now support for the code-fix?
Thank you for all your help!
Camila

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 10:06 AM
Hi Camila, this is an enhancement request - we have not supported the duplicate tag scenario by design. So we wait for more customers to vote on the idea, till we take this up into the product in upcoming releases.
for now though i have made code changes to support this use-case, which you can test out. i am not from support or engineering, just offering this as a quick fix and reference for you to test out.
Please read the details of the update-set at the link below, so you understand what's been fixed here.
this fix is only to bring to sight those tag values that are incorrect.
please import this update-set and see if it works for your needs.
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 01:37 PM
Hello @Ram Devanathan1 sorry for taking so long to reply. I put your changes in my develop instance. However, now it acts like everything is right.
It accepts any values as correct.
I tried changing code and making some modification but didnt work.
Here is the Application Numbers
Here is the key value table:
Here is the policy set up:
Here is the policy results:
Expected:
SAP AppSRV01 - Failed
SAP AppSRV01 - Certified
SAP AppSRV01 - Certified
SAP AppSRV02 - Failed
Thank you!
Camila
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 02:22 PM
@Ram Devanathan1 a coworker found what was missing. It was just a "var violations = [];"
Now it is recognizing when it fails.
I am doing more tests and I will get back to you soon.