- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2016 07:13 AM
We like to send an email notification to the Problem.assigned to, when an Incident is added to a Problem ticket. We can have several incidents associated to a problem, we need to be able to query a record being added to the related list. Trying something like below.
var incident = new GlideRecord("incident");
incident.addQuery ??
incident.addQuery ??
incident.query();
while (incident.next())
gs.eventQueue("incident.added", current, current.assigned_to.getDisplayValue(),
current.work_notes = "Email sent to: " + current.assigned_to.getDisplayValue();
current.update();
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2016 07:18 AM
Create an after business rule on incident table
when: after insert and update
conditions: problem is not empty AND problem changes
Script:
var gr= new GlideRecord('problem');
gr.get(current.getValue('problem_id'));
gs.eventQueue("incident.added", gr, gr.assigned_to);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2016 07:18 AM
Create an after business rule on incident table
when: after insert and update
conditions: problem is not empty AND problem changes
Script:
var gr= new GlideRecord('problem');
gr.get(current.getValue('problem_id'));
gs.eventQueue("incident.added", gr, gr.assigned_to);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2016 08:25 AM
Thank you Abhinay, would the email notification and event, also be on the incident table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2016 10:39 AM
Awesome, thank you so much....It's working..:)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2016 08:36 AM
Email notification and event should be on problem table. BR should be on incident table