Need to see the created Change in the work notes section

Abhilasha G T
Tera Contributor

Hi Team ,

In the incident form, i want see the created Change records in the work notes section.

 

How to achieve this.

 

Regards,

Abhilasha G T

15 REPLIES 15

Hi Rohit,

Thanks for your reply,

I have added /configured the change request field on the Filter Activity in the notes tab.

Regards,

Abhilasha G T

SupriyaWaghmode
Kilo Sage

Hello , 

 

On the the incident table - please check any field exist to track the change number/if not add custom field to which will update the change number once created from incident.

Add the script on creation of change from incident to update the change number in the work notes of incident.

 

Thanks & Regards ,

Supriya Waghmode |ServiceNow Consultant

Hi Supriya,

 

Thanks for your reply, we are not supposed to create any custom field.

 

Regards,

Abhilasha G T

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhilasha G T 

in your screenshot it's already there.

What's required extra?

You can use after insert business rule on CHG table

Condition: current.parent.sys_class_name == 'incident' && current.parent != ''

Script:

(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var gr = new GlideRecord("incident");
    if (gr.get(current.parent)) {
        gr.work_notes = 'Change ' + current.number + ' has been added under incident' + gr.number;
        gr.update();
    }

})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi Ankur,

Thank you for your response.

I created the change record through incident, but that change record not sitting in the related tab of change request. I have added manually the related change request on the incident form. In PDI OOB also its not working.

I have two use cases: 

 1. When I create a change from the context menu, and the change is reflected in the Related records tab - Change Requests

 2.I am able to see all these changes in the work notes section of the incident record
So that I can see a history of all fix attempts that relate to the incident in question

Regards.

Abhilasha G T