Notification - Incident assigned to me

Dilip P
Kilo Contributor

Hi, this is about OOB Notification "Incident assigned to me".

This notification is sending notification to me even though I am not the "assigned_to".

However I checked the logs and the recipient is different. I don't know why I receive the email.

Please note that except 2 users in the system none of the Users have valid email address, This is a demo instance

find_real_file.png

 

2. Who will receive

find_real_file.png

3. What it will contain

find_real_file.png

 

logs:

find_real_file.png

still I receive the email to my Inbox. I wonder why

find_real_file.png

9 REPLIES 9

I have another question please. Why is that none of the emails sent or even found in logs when I tried to change the assigned to person.

Note: all the users have "@example.com" but the logs should appear right?

The events not triggered to assigned to the condition is as per the images I shared before in the initial content.

find_real_file.png

Hi Dilip,

 

The place where you check if not logs its Activity stream. Sent the mails are not of type: sent it will not appear in logs.

If you want to check look for

System Logs >> Emails from application navigator. You will find all emails to be processed/sent/send-ignored, etc. there which gives you an understanding to whom the mail will be sent.

O, one last condition I need to implement please

I need to set the name instead of "email.origemail" how to do it?

Also I need to set the name accordingly if it is caller or assigned to .

gs.include('validators');

if (current.getTableName() == "incident") {

var gr = current;

if ((email.subject.toLowerCase().indexOf("reopen") >= 0) || (email.body_text.toLowerCase().indexOf("reopen") >= 0))
gr = new Incident().reopen(gr, email) || gr;

//To set the latest reply as additional comments upon reply from "caller"

var removefrom = email.body_text.indexOf('From: ');

if (email.from == gr.caller_id.email) {

gr.comments = "reply from: " + email.origemail + "\n\n" + "Customer update:" + "\n" + email.body_text.substring(0, removefrom);
}

//To set the latest reply as work notes upon reply from the "assigned to"

if (email.from == gr.assigned_to.email) {
gr.work_notes = "Inbound Email Response from: " + email.origemail + "\n\n" + "Reply from Service Desk Agent:" + "\n" + email.body_text.substring(0, removefrom);

}


gr.update();
}

 

In first one it has to be caller and in second bold one it should be assigned to.

How to do this. Please help!!

Hi Dilip,

Ideally this should have been a separate thread altogether. Anyways, email.orgiemail will always return email address of the sender & I see gr.caller_id as well so use gr.caller_id.getDisplayValue();.

Since for user table Display Value is Name it will give you name.

Something as below.

gs.include('validators');

if (current.getTableName() == "incident") {

var gr = current;

if ((email.subject.toLowerCase().indexOf("reopen") >= 0) || (email.body_text.toLowerCase().indexOf("reopen") >= 0))
gr = new Incident().reopen(gr, email) || gr;

//To set the latest reply as additional comments upon reply from "caller"

var removefrom = email.body_text.indexOf('From: ');

if (email.from == gr.caller_id.email) {

//gr.comments = "reply from: " + email.origemail + "\n\n" + "Customer update:" + "\n" + email.body_text.substring(0, removefrom);
gr.comments = "reply from: " + gr.caller_id.getDisplayValue()+ "\n\n" + "Customer update:" + "\n" + email.body_text.substring(0, removefrom);

}

//To set the latest reply as work notes upon reply from the "assigned to"

if (email.from == gr.assigned_to.email) {
//gr.work_notes = "Inbound Email Response from: " + email.origemail + "\n\n" + "Reply from Service Desk Agent:" + "\n" + email.body_text.substring(0, removefrom);
gr.work_notes = "Inbound Email Response from: " + gr.caller_id.getDisplayValue() + "\n\n" + "Reply from Service Desk Agent:" + "\n" + email.body_text.substring(0, removefrom);

}


gr.update();
}

Dilip P
Kilo Contributor

Yes, I think it is. I will test.

 

Thanks

DP