Include CI's child classes on reference qualifier on Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2024 06:32 AM
Is it possible to modify a configuration item reference qualifier on Incident to return all CI's of a parent class and child class CI's as well. Currently you can specify individual classes but I would like to return all CI's below the Service class for instance. How can we achieve this??
Thanks in advance!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2024 06:41 AM
HI @Delapan
You need to check the Override - Reference Qualifier only for Incident.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2024 06:48 AM
Hi Atul,
I have override the CI on Incident "sys_class_name=cmdb_ci_service". But its only displaying CI's related to Services not its associated child classes such as (Application service, Application Service group)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2024 07:15 AM
Hi @Delapan
I guess reason is the application services and all depend on classification field and it show only parent.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2024 06:50 AM
HI @Delapan
You can modify the Configuration Item (CI) reference qualifier on the Incident form to include both parent and child class CIs. Here's how you can achieve this, along with some considerations:
Methods to Modify Reference Qualifiers
1. Dictionary Override (Recommended):
* This is the preferred and most maintainable way to customize reference qualifiers.
* Navigate to the Incident form.
* Right-click the CI field label and select Configure Dictionary.
* In the Reference Specification section, set the Reference qual to "Advanced" and use a script to build your query.
2. Client Script:
* You can also use an onChange or onLoad client script to dynamically modify the reference qualifier. However, this method is less efficient than a dictionary override and can impact performance with large datasets.
Script Logic for Parent/Child CI Filtering
Here's a sample script you can use for the "Advanced" reference qualifier or in a client script:
// Get the sys_id of the parent class (e.g., Service)
var parentClassSysId = 'cmdb_ci_service'; // Replace with actual sys_id
// Build the query to include both parent and child classes
var ciQuery = 'sys_class_name=' + parentClassSysId + '^ORsys_class_nameIN' + new GlideRecord('sys_db_object').getDescendantClasses(parentClassSysId);
// Return the query string
ciQuery;
If you like this opinion. Please kindly mark this your best answer OR Helpful and help me to contribute more to this community