Send email notification when Incident is added to a Problem

alhicks
Tera Guru

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();

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

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);


View solution in original post

4 REPLIES 4

Abhinay Erra
Giga Sage

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);


Thank you Abhinay, would the email notification and event, also be on the incident table?


Awesome, thank you so much....It's working..:)


Abhinay Erra
Giga Sage

Email notification and event should be on problem table. BR should be on incident table