- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2022 12:19 AM
Hi,
For Incident managing, I have 10 categories and respective subcategories.
For Catalog Items(Record Producer to "Raise an Incident") I am using same values of category and subcategory.
But for another Catalog Item(Record Producer to "Raise Security Incident") I want to show only 5 categories and respective subcategories.
I want to restrict values of categories for specific Catalog Item.
I think need to use "catalog client script" but don't know to how and what should be script.
Please help me to restrict values of categories for specific Catalog Item.
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2022 01:07 AM
Answer:
Use following code as per requirement:
//g_form.addOption('variable_name', 'choice value', 'choice lable');
g_form.clearOptions('category') // is important to clear available set of categories
g_form.addOption('category', 'hardware', 'Hardware'); // to add category option
g_form.removeOption('category', 'Login Issue', 'Login Issue'); // to remove category option
Thanks
-KV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2022 12:27 AM
You can use onload Catalog Client Script and use g_form.addOption('variable_name', 'choice value', 'choice lable');
for example :
g_form.clearOptions('category')
g_form.addOption('category', 'hardware', 'Hardware');
g_form.addOption('category', 'software', 'Software');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2022 01:01 AM
Thank You for response.
Your answer helped me. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2022 12:00 AM
Your Welcome,
Can you mark my answer as helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2022 12:42 AM
Hi,
Do you want to show only few categories in record producer form or in the created incident?
If in record producer, in the category variable you can add only the required options.
1) In 'Raise an incident' record producer, open the category variable, add the required options in select box
2) In 'Raise Security Incident' record producer, open the category variable, add the only few required options in select box.
If you are using same variable set for both catalog items, then only you need to go with client script. or else client script isn't needed.
Mark as correct and helpful if it solved your query.
Regards,
Sumanth