create incident ui action

calvin_j_gerald
Giga Contributor

Has anyone created an incident for the customer or break fix request for customer/contact in the customer service management application?

9 REPLIES 9

Mihir Mohanta
Kilo Sage

Please go through below thread.It might help you.


Need a tip for a UI action - create incident from catalog task



Thanks,


Mihir


Chuck Tomasi
Tera Patron

Hi Calvin,



Yes, this can be done quite easily. If you are looking to bring information from the CSM case to the incident, you simply need to identify which fields to map from/to.



UI Actions - ServiceNow Wiki



The UI action script would look like something like this (modifications required to meet your needs.)



var inc = new GlideRecord('incident');


inc.newRecord();


inc.short_description = current.getValue('short_description');


inc.caller_id = current.getValue('contact');


// Add additional fields here


inc.insert();


gs.addInfoMessage('New incident created: ' + inc.number);


action.setRedirectURL(inc);


Linda S
ServiceNow Employee
ServiceNow Employee

Just one small update on line 4 - current.getValue('contact');



Works great!


Thank you. - corrected.