How to get RITM number in Change Related List

bijender1
Tera Contributor

Hi,

We want to create Change Request from RITM, which is possible by activating "create change " UI action. However ,while creating Change request from RITM, change number is showing in RITM, but not in Change request.

find_real_file.png

Kindly advise if we can get RITM number in Change request also.

find_real_file.png

 

Regards,
b

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

can you check what is the query for the defined relationship

on the change request I assume parent field gets populated with RITM hence the Change request is being showed in the related list of RITM

Are you storing the CHG record on RITM? if not then it won't show in related list

please populate the parent field of RITM with the CHG number and it would start showing up

Regards
Ankur

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

Hi Ankur,

I just have activated the SNOW provided UI action "Create Change"for Sc_req_item table , after which when creating change from RITM it shows CHG number in RITM form ,

But in CHG it is not showing RITM number. Can you advise me to populated RITM number in CHG.

Hi,

So you will have to pass the change request sys_id from the UI Action.

Create a hidden variable on catalog item and then set that hidden variable with the CHG sys_id

Then in workflow run script of your catalog item set the CHG sys_id in the parent field of RITM

Then the RITM will start showing in the related list of CHG record

OR

Another approach would be

1) create after update BR on change_request table

2) condition as parent.number contains CHG

3) get the parent sys_id i.e. the RITM sys_id

4) query RITM and then update the parent field of RITM with the chg sys_id

Regards
Ankur

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

@bijender 

sample script in the BR

BR: After update on change_request

Condition: parent is not empty && parent.number contains CHG

Script:

var parentSysId = current.parent;

var ritmRec = new GlideRecord('sc_req_item');

ritmRec.get(parentSysId);

ritmRec.parent = current.sys_id;

ritmRec.update();

Regards
Ankur

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