The CreatorCon Call for Content is officially open! Get started here.

Linking RITM to a CHG

dianeramos
Tera Contributor

We have a requirement to link RITM to a CHG record.

We are able to do this, but there are cases when an RITM needs to be linked to 2 CHG records.

Scenario: When RITM123 is linked to CHG123, and we link the same RITM123 to CHGXYZ ---- the link is broken on RITM123 and CHG123. It behaves like an RITM is only allowed to be linked ONCE.

How can I change this to allow it to be linked multiple times? 

Thanks in advance

32 REPLIES 32

Hi Dhruv,

Use this code in Change request table:

 

gs.log('RITM Number', current.parent.getDisplayValue()); // Please check the log value

var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.parent);
gr.query();
while(gr.next())
{

gs.log('RITM Nmber under loop', current.parent.getDisplayValue()); // Please check the log value
gr.state = '4';
gr.update();
}

After running this script, can please share the log value you are getting.

Thanks
Shashikant

Hit Helpful or Correct on the impact of response.

getting RITM value in both logs 

Modify this and try:

gr.state.setDisplayValue('Closed Incomplete');

Thanks
Shashikant

Hit Helpful or Correct on the impact of response.

No.. it is not working now it is not showing any value in state field ..

If we set two parent records - like in change we use ritm as parent and in ritm use change as parent , i think in this case it is not going to work 

Gagan10
Giga Contributor

Select parent fields on RITM table try to configure related list there