Set a choice list value from record producer script.

Sam Ogden
Tera Guru

Hi All,

I've created a record producer for some incidents.   All the incidents created via this record producer will be Sev 2 so we are not asking them a severity question.

I have been trying to set the value of the questions in the record producer script but not having any luck.

Back end incident form has the following fields:

find_real_file.png

The answer to 'number of users affected' & 'number of transactions affected'   set the value of the 'impact' field.

Then the answers to 'impact' & 'urgency' then set the value for 'severity'

Below is an example of how the choices are setup.

find_real_file.png

In the record producer script I have the following:

find_real_file.png

I have also tried with '2' and "2" and still it does not set the value in the back end incident form.

Any help as to where   I am going wrong is greatly appreciated.

Thanks

Sam

1 ACCEPTED SOLUTION

Thanks Michael, I was not aware.


Sam the only way now is locate the error using gs.log. Maybe you can also copy the last three rows of your script in a new record producer, it will work.



Regards,


Valentina


View solution in original post

25 REPLIES 25

Valentina6
Giga Guru

Hi Sam,


try this:



current.setValue('u_number_of_operators_affected',2);



Hope it works!



Regards,


Valentina


Hi Valentina,



Thanks for your quick response, just tried the above, but unfortunately still having the same issue:



find_real_file.png



Thanks



Sam


Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Sam, what is the field type for the u_number_of_operators_affected and u_number_of_policies_affected fields?   Are they strings or integers?   You can right click on the field labels on your incident and click Show and it will tell you the type.


Hi Michael,



Thanks for the quick response, the fields are string:



find_real_file.png