Mapping Business Impact field to Incident table

ryanduclos
Kilo Expert

Hello everyone,

I am currently using a record producer in the service catalog for ESS users to create an incident.

A new requirement popped up where we want to showcase 4 text options where each one would correspond with the correct impact value.

For example, would be nice to have radio button variable that had these options

"Service Interruption affecting whole site or network, mission critical server or service, or critical application on a managed Server." - This would map to the impact field with the value of 1.

"... option 2" - this would map to the impact field with the value of 2
"...option 3" - etc.

"...option 4" - etc.

I tried creating 4 checkbox variables that held the above options, but these only return true or false and I can't pass an integer value over. My second attempt was to try and use a catalog client script onSubmit() to see what checkbox was checked and then set the impact field on the incident table, but doesn't look like the script has access to the incident table at this point in time.

It seems the only way I can map values to the impact field is using an option set, but option sets limit the amount of text and so using the descriptive options like above is not possible.

Am I missing something? Or am I going to have to just simplify the option set to being Critical - 1, Major - 2, Minor -3, etc..?

Thanks for any insight into this.

1 ACCEPTED SOLUTION

amathews
Kilo Expert

On your record producer, create a select box variable, match the values on the on the select box questions to the impact values. map the fields and you should be good to go.


View solution in original post

5 REPLIES 5

ccajohnson
Kilo Sage

You should be able to use the script portion of the record producer record.


Create a record producer


In what capacity? Does the record producer script have access to the incident table because that is where the insert is going to take place?


The script portion of the record producer record allows you to set fields on the target record.



You use current.field_name to set a given field. In your example, you will use current.impact



In this example, I will check the values of two checkbox variables (impact_one, impact_two) then set the current.impact accordingly:


var setValue = 4; //the default value of impact


if (producer.impact_one == true) {


      setValue = 1;


}


if (producer.impact_two == true) {


      setValue = 2;


}


current.impact = setValue;



Note: Since you are using checkboxes, you may need to write some sort of onSubmit() or onChange() catalog client script to guarantee that only one checkbox is checked.


rohantyagi
ServiceNow Employee
ServiceNow Employee

You may want to use the variable type: "Numeric scale" and put the description of what 1, 2 or 3 correspond to in the Help or instructions tab and select "Show Help" "Always Expanded"



find_real_file.png