how to auto populating category and subcategory based on the CI class?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 08:35 AM
populating category and subcategory based on the CI
#incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 12:40 PM
Hi @RMU ,
why would you do that? Can’t there be several rights answers in category/subcategory for the same CI?
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 12:48 PM
Hi,
If it involves application Configuration Items (CIs), you can auto-populate them using a script. You can utilize the Category and Subcategory of the Application CIs for this purpose. 😊
If you believe the solution provided has adequately addressed your query, could you please **mark it as 'Helpful'** and **'Accept it as a Solution'**? This will help other community members who might have the same question find the answer more easily.
Thank you for your consideration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 09:50 PM
can you provide script please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 01:35 AM - edited 05-28-2024 01:37 AM
Hi @RMU ,
You'll have to write a script to fetch the category and subcategory from the related Configuration Item (CI) and populate the corresponding fields on the Incident form.
Try below code in BR:
(function executeRule(current) {
// Check if Configuration Item (CI) is populated
if (current.cmdb_ci.nil())
return;
// Query Configuration Item to get its category and subcategory
var ciGR = new GlideRecord('cmdb_ci');
if (ciGR.get(current.cmdb_ci)) {
// Populate Category and Subcategory fields on the Incident form
current.category = ciGR.getValue('category');
current.subcategory = ciGR.getValue('subcategory');
}
})(current);
If you find my response helpful, please consider selecting "Accept as Solution" and "Helpful" .
Thanks,
Anusha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 01:45 AM
Hi @RMU ,
There can be numerous CI which needs the defination of setting cat and subcat based on CI, if its for specific set of CI lets say 10-20 your can set then via client script. but its not recommended to do for bigger numbers.
Try using tools like predective intelligence which can do the job for you...
let me know more info on what exactly your looking and what approch have you planned ?
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....