Need to configure a notification when incident was opened on behalf ?

Deepika61
Tera Contributor

Hi All,

Actually i have a requirement that we have two fields caller and logged user, So whenever i request a incident on behalf of someone i need to sent email to caller?

1.And here two conditions are there like if caller and logged user same then we need to send email only caller

body contans like

incident opened

short description

descrition

portal link

2.second condition was like if caller and logged user different need to sent email to caller?

body

incident was opened on behalf by (created by name)

short description

descrition

portal link

need to check the condition and then sent a mail?

This was achieve in only one notification , please help me to achieve this?

Thanks

Deepika

 

1 ACCEPTED SOLUTION

suvro
Mega Sage
Mega Sage

You can write email script

 

like

if (current.caller == current.u_logged_user){

template.print("incident was opened on behalf by "+current.u_logged_user.getDisplayValue());

}

else {

template.print("incident opened "+current.caller_id.getDisplayValue());

}

In the notification email body you can use

${mail_script:<name of the email script>}

 

View solution in original post

4 REPLIES 4

Musab Rasheed
Tera Sage
Tera Sage

Hello,

In notification, you can add condition like below

For 1st scenario

find_real_file.png

For 2nd Scenario

find_real_file.png

I have used Opened by field so you can replace with your field, Rest of the content you can add easily

Mark my answer as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Hi Rasheed,

Thanks for the response,

Actually basically i need to check the both the condition and then send a single email notification only for both senarios

As i thought may we can do it by check the condition in email script ?

So please provide those script to validate the conditions

Thanks

Deepika

suvro
Mega Sage
Mega Sage

You can write email script

 

like

if (current.caller == current.u_logged_user){

template.print("incident was opened on behalf by "+current.u_logged_user.getDisplayValue());

}

else {

template.print("incident opened "+current.caller_id.getDisplayValue());

}

In the notification email body you can use

${mail_script:<name of the email script>}

 

Deepika61
Tera Contributor

Hi Survo,

Thanks for the code, its work for me.