How to create a relationships between task and change request table?

Erica2
Tera Contributor

Hello,

I have been attempting to establish a relationship between the task and change request tables, but I have been unable to display the change request number in the catalog task.

 

Here is what I have done.  Hope someone could provide suggestions.

Erica2_2-1696454604998.png

 

 

 

It suppose to displays the change request number in the Test Change Request Tab, but it not.

 

Erica2_0-1696454329904.png

 

Thank you

 

 

 

1 ACCEPTED SOLUTION

Hello @Erica2 ,

Please give it a try and let us know if it works out for you.

Brian186_0-1696606963505.png

 

 

 

View solution in original post

4 REPLIES 4

Chaitali_Vale
Mega Sage
Mega Sage

Hello @Erica2  , 
Please follow the below scripting : 
var chg = new GlideRecord('change_request');
chg.setValue("parent",current.sys_id);
if(chg.get(current.rfc)){
if(chg.parent == ''){
chg.parent = current.sys_id;
chg.update();
}
}

Chaitali_Vale_0-1696482347988.png

 

Chaitali_Vale_1-1696482378391.png

 

Please mark my answer correct or helpful, if applicable.
Thanks & Regards,
Chaitali Vale

Good morning @Chaitali_Vale 

Thank you for providing the code.  I have tried the code, but run in to an issue where all the change request number are returned.  Is it possible that we can filter only the change request number that tied to specific RITM?

Erica2_0-1696521896253.png

 

 

Hello @Erica2 ,

Please give it a try and let us know if it works out for you.

Brian186_0-1696606963505.png

 

 

 

Erica2
Tera Contributor

Hi @Brian186 

It is working perfectly. Thank you.