How to create a change record from UI action on incident form.

Sourab
Kilo Contributor

How to create a change record from a UI action on incident form and pass some details to the change record such as,  short description from the incident form or any other field.

Thanks

1 ACCEPTED SOLUTION

Here is the sample code which maps incident details to change and creates a change record.

var change = new GlideRecord("change_request");
change.initialize();
change.short_description = current.short_description; // incident Short description mapped to change short description.
change.description = current.description;
change.cmdb_ci = current.cmdb_ci;
change.priority = current.priority;
var changesysID = change.insert();
action.setRedirectURL(change);




Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

11 REPLIES 11

Sourab
Kilo Contributor

What's the syntax for opening a change record. I am trying this but this is not working

try

change_request.do instead of change.do

Thanks