Multiple dependent values for closure codes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-04-2022 01:57 AM
I've created a specific set of closure codes (resolution codes) for one specific category of incident. I've set close_code to be dependent on category and have the choices for that specific category in place now for the new choices. The existing close codes need to still apply to all the other categories of incident but of course no longer do as a result of the additions I've made. I know from checking the answers to previous questions posed about using multiple dependent values that one way to achieve this is to recreate this set of choices multiple times per category. This will make our reporting more complex to maintain so I'd prefer not to take this route.
I have seen mention of other ways to achieve the use of one set of choices across the remaining categories by scripting but I don't know where to start as my JS is limited. Can anyone help please?
- Labels:
-
Incident Management
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-04-2022 02:21 AM
Hi,
As per my understanding on above query, you need to add some additional choices on close code for specific category and for other category the close code remains as OOB choices. If this is so then below are the things by which you can achieve this.
Suppose for category (Network) you need to have additional choices for close code
And for other categories the close code remains as OOB.
For Network category create a client script (OnChange - Category)
var cat = g_form.getValue();
if(cat == 'network'){
g_form.clearOptions('close_code');This will clear all the existing choice.
//Now add your choice for network category
g_form.addOption('close_code', 'Value1', 'New Choice Lable 1', 1);
g_form.addOption('close_code', 'Value2', 'New Choice Lable 2', 2);
g_form.addOption('close_code', 'Value4', 'New Choice Lable 3', 3);
}
Mark this as Helpful/Correct, if Applicable.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-04-2022 09:36 AM
Hi Sourabh
Thanks for this. I've created the client script and made the modifications for the category and some sample choices.
It isn't working for me. What have I missed? I removed the dependency of close code on category and haven't created the new choices to be used for the close codes for the specific category assuming they should be created by the script.
thanks
Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-05-2022 01:42 AM
Share the screenshots for the configurations and form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-06-2022 03:08 AM
I tried changing the use of var (cat) to look for the newValue and it is working now:
It's working in my personal dev instance but because the oldValue is populated when opening a new incident. In my client dev instance the incident starts with category -none- so it doesn't set the values until the incident has been saved with another category first.