How to get RITM number in Change Related List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 12:44 AM
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.
Kindly advise if we can get RITM number in Change request also.
Regards,
b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 01:05 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 01:54 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 02:24 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 05:15 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader