Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Copying Incident Fields When Creating Change Request

rohanaditya
Kilo Sage

When creating a Change Request from an Incident, it is often useful to automatically copy relevant field values from the Incident to the Change.

ServiceNow already copies some OOB task fields, but organizations usually need additional fields or custom logic.

Instead of manually populating fields every time, we customize the Create Change page in UI Builder.

 

Step 1: Duplicate the OOB Create Change Request Page

 

Navigate to UI Builder, search for "Service operations workspace" and locate the page.

create-change-request-page

 
b11img1.png

 

Click on it to open this page in Editor. On the top middle you can find "Settings". Click on it.

b11img2.png

 

Give a lower order value than the OOB page to make sure it loads first and then the OOB page.

b11img3.png

 

Field Copy Scenarios

There are two scenarios when copying fields from Incident to Change Request.

  1. Copying task table fields
  2. Copying custom fields
 

Copying Task Fields

ServiceNow already copies certain task fields when creating a Change.

Open the new page in Editor and navigate to:

Client State Parameters → taskFields

b11img4.png

 

 
b11img5.png

 

Verify the fields in the Initial Value property.

Example:

short_description,description,cmdb_ci,priority,assignment_group

These fields are automatically copied from Incident → Change Request.

To copy additional task fields, simply add them to this list.

Example:

short_description,description,cmdb_ci,priority,assignment_group,impact,urgency
 

Copying Custom Fields

There are two possibilities when dealing with custom fields.

 

Case 1: Custom Field Exists on Task Table

If the custom field:

  • Belongs to the task table
  • Exists on both Incident and Change Request

Then simply add it to taskFields.

Example:

short_description,description,u_business_service

The field will automatically copy.

 

Case 2: Custom Fields Are Different

If fields are not shared between tables, we must modify the client script.

Navigate to:

Client Scripts → Additional Query data from Task

 
b11img6.png
 

Client Script Logic

The script:

  1. Fetches the source record (Incident)
  2. Builds an encoded query
  3. Maps values into the Change form
 

Custom Mapping Example

Sometimes fields must be mapped differently.

Example: u_incident_field → u_change_field

Example logic:

if (record.u_incident_field && record.u_incident_field.value) {
    query += '^u_change_field=' + record.u_incident_field.value;
}
 

Final Result

When clicking Create Change from Incident:

  • Task fields are copied automatically
  • Custom fields can be mapped
  • Additional logic can be applied

This allows:

  • Faster Change creation
  • Consistent data transfer
  • Less manual work for agents
 

For more blogs visit my personal blog site:

https://rohanaditya-servicenow.vercel.app

0 REPLIES 0