Notifications

510 views

Description

There is an OOB catalog item 'Create Incident' feature from the 'Help' section of the Service Catalog. End users use this Service Catalog item to create incidents. If a user wants to add a subcategory field to help users narrow down their issue based on the Category they selected they can make use of this article.

Resolution

First, the Category variable has to have reference to the Category column within the incident table, but the Subcategory variable to needs to refer the Label column within the sys_choice table whose lookup value field is Label. You have to make the variable a lookup select box type field. In the type specification, you need to add a Reference qual attribute to simplify the filter process.

javascript: 'inactive!=true^name=incident^element=subcategory^dependent_value=' + current.variables.category

This attribute filters the results by removing inactive entries (inactive=false), limiting the results to the Subcategory Dictionary entry(element=subcategory), which was created in the incident table and returning only the Labels that contains a specific dependent_value.

The dependent_value is a column in the sys_choice table used to create symbolic links between the choices of one Dictionary entry with a dependency on another Dictionary entry. In this example, the Subcategory Dictionary entry in the incident table has a dependency on the Category Dictonary entry, so all our subcategory choices will have a dependent_value that matches a category choice.

Because the dependent_value column isn't part of our Subcategory Dictionary entry, if we try to reference it directly in the Lookup Select Box, it will return every subcategory instead of only returning the ones from a specific category.

Next, use the following Variable attribute from the Default Value tab:
ref_qual_elements=category

This attribute causes the the list our Reference qual returns from the sys_choices table to refresh whenever the Category variable is updated. Now the filtering is working as expected.

 

 

 

 

Article Information

Last Updated:2020-04-08 08:49:48
Published:2020-04-08