change request in related task of RITM

Sraj1
Giga Contributor

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);

2 REPLIES 2

Nayan Mahato
Tera Guru

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

 

 

What do you mean by map the source field of the change request with the RITM?