change request in related task of RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2022 02:23 PM
i am trying to create a relationship table but its not working. Can anyone refer me what is wrong here and how can i get sys id of current table?
(function refineQuery(current, parent) {
//parent is change_request
//current is RITM
// sys id of parent of change request
var version = [];
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number', parent.number);
gr.query();
while (gr.next()) {
version.push(gr.getUniqueValue());
}
current.addQuery('sys_id', 'IN', version.toString());
gs.log("Sunday: "+ version.toString());
gs.log("sys id of current table : " current.sys_id) //this is not printing anything.
})(current, parent);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2022 08:12 PM
Hi Sraj,
I don't think that we need to create a relationship between RITM and Changes because we do have already have an OOB relationship between these two tables. In sc_req_item form related list you can see there is a related list called "Change request" so you can map the source field of the change request with the RITM. Hope this will help, if not could you please provide a screenshot of your relationship script along with "Applies to table" and "Queries from table"? Thanks.
Regards,
Nayan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2023 07:25 AM
What do you mean by map the source field of the change request with the RITM?