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-14-2018 08:18 AM
You can write OnAfter business rule.
Conditon when State is Closed Completed
var ritm= new GlideRecord('sc_req_item');
ritm.addQuery('sys_id', current.parent);
ritm.query();
while (ritm.next()){
ritm.state = RITM state value;
}
ritm.update();
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-14-2018 10:08 AM
Tried this logic but it is setting RITM to close complete. Any other method ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-14-2018 10:25 AM
Can you please share your script or screenshot.
You want to close incomplete RITM from Change request right?
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-14-2018 10:42 AM
Yes...
BR: running on change table, after update and insert
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.parent);
gr.query();
while(gr.next())
{
gr.state = 4;
}
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-14-2018 10:53 AM