Linking RITM to a CHG

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-14-2018 07:26 AM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 08:06 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 08:18 AM
getting RITM value in both logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 08:36 AM
Modify this and try:
gr.state.setDisplayValue('Closed Incomplete');
Thanks
Shashikant
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 08:44 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-14-2018 07:33 AM
Select parent fields on RITM table try to configure related list there