- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 09:03 AM
Hello
I have an issue, when I close an incident, the interaction related to that incident does not close, where do I check this please.
Solved! Go to Solution.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2020 02:11 AM
Ok,
Then the BR is on Incident table. After - Update
Condition: incident is closed
Script:
ar gr = new GlideRecord('interaction'); //check table name
gr.addQuery('sys_id', current.u_interaction);
gr.addQuery('active', true);
gr.query();
while(gr.next()) //if there is only 1 interaction, you can use if instead of while
{
gr.state = 3; //check closure state value
gr.comments = 'Interaction Closed'; //optional
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2020 01:36 AM
Cool. Then you want to close the all incident when the interaction is closed
The below should be a BR on Interaction (running after update, condition: interaction state changes to closed)
var gr = new GlideRecord('incident')
gr.addQuery('u_interaction.sys_id', current.sys_id);
gr.addQuery('active', true)
gr.query();
while(gr.next())
{
gr.incident_state = 3;
gr.comments = 'Interaction Closed'; //optional
gr.update()
}
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2020 01:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2020 01:57 AM
Im Sorry , im confused. Park request for now and talk about incident
What is closing what?
Interaction is closing incident or incident should close interaction?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2020 01:58 AM
Incident should close interaction 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2020 02:11 AM
Ok,
Then the BR is on Incident table. After - Update
Condition: incident is closed
Script:
ar gr = new GlideRecord('interaction'); //check table name
gr.addQuery('sys_id', current.u_interaction);
gr.addQuery('active', true);
gr.query();
while(gr.next()) //if there is only 1 interaction, you can use if instead of while
{
gr.state = 3; //check closure state value
gr.comments = 'Interaction Closed'; //optional
gr.update();
}