How to auto populate requested for on the request form when it is created from an incident(caller_id)

Kevin68
Tera Expert

How to auto populate requested for on the request form when it is created from an incident(caller_id)

Incident form

find_real_file.png

 

when clicked on create request button , service catalog opens and when we select a catalog item

find_real_file.png

I want to display the requested by field with the caller_id field from Incident form.

 

please help

15 REPLIES 15

Barrilito van D
Kilo Guru

Hi Rahul,

Without looking at an instance I would say this is a UI action on the incident form, lookup the ui action, see what it does to open the request and send the data along.

ui action

find_real_file.png

when clicks on the create request button on incident form

it reverts to service catalog form that allows us to select the catalog item from which we can raise the request as shown in the question

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can do this

UI Action Code:

gs.getSession().putClientData('requested_by', current.caller_id);

onload Catalog client script on that catalog item

var requestedByUser = g_user.getClientData(''requested_by');

if(requestedByUser != ''){

g_form.setValue('variableName', requestedByUser);

}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

i am not looking for specific catalog item, the catalog item can be anything. but the requested by field should auto populate the caller_id value