Filter condition - adding a 'is a' option through script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 05:24 AM
Hi,
On CMDB Data manager, when setting up a new certification policy and defining the condition for the CI Class, it doesn't have the Class 'is a' option. This is useful, so that we can include bunch of classes under 'server' for example.
Is there a way we can get around this, through javascript? Or does anyone know how we can have this option added onto data manager policies?
Thanks.
Chaz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 11:36 AM
Hi @Chaz_ - You might be able to modify the data filter condition builder in UI Builder (CMDB Workspace > Data Manager Policy Form), but—even if you manage it—I wouldn’t recommend it. Unless there are hundreds of extensions, it’s probably best to just add Class is Server AND Class is x AND Class is y...and so on.
That said, you could theoretically work around the issue by updating the Encoded Query on the CMDB Data Management Certification Policy record [sn_cmdb_ws_dm_certification_policy], after you've created the policy. It probably won't let you do it in the UI, but it should work via background script.
Class is a Server would be:
policyGr.setValue('encoded_query', 'sys_class_nameINSTANCEOFcmdb_ci_server');
Note: This is untested, and I have no idea if modifying the encoded query in this way will break anything in the workspace, or anywhere else.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 03:05 PM
Hello Chaz,
I see it differently in my instance, can you share the screenshot or the path.
I see the class is a option enabled in my data manager.
Best regards
Surya Prakash Garg
Connect me on Linked In
https://www.linkedin.com/in/spgarg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 02:31 AM
Hi,
Here is a screenshot showing 'is a' option does not exist,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 10:57 AM
you are right, i can't see it in the CMDB workspace, but I can see this option in the data certification under All menu.
Best regards
Surya Prakash Garg
Connect me on Linked In
https://www.linkedin.com/in/spgarg/
