Configure incident notifications

Day2
Kilo Contributor

I need help following these steps

 

 

Configure incident notifications

As a user, I want to be notified when an incident is created for me. Users should not be able to unsubscribe from the notification. 


1. Set the notification "Incident opened for me" to be mandatory. (Note: 'The mandatory' field may need adding to the form). A user should get a notification even if they created an incident for themselves.


2. Update the "incident_has_been_opened" mail script so that the message contains the "Opened by" user information.

1 ACCEPTED SOLUTION

Pratiksha Kalam
Kilo Sage

Hello,

1.You can create notification on event and add your name in "who will receive"

find_real_file.png

find_real_file.png

 

2.(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {

var task = current.sysapproval.sys_id;
var service = current.sysapproval.hr_service;


email.setSubject(service.getDisplayValue() + ': Approval Required for ' + task_num);
template.print(gs.getMessage('Hello ' + approver.first_name + ',' + '<br />'));
template.print(gs.getMessage('A new HR Case has been created which requires your approval to fulfill.' + '<br />'));

If answer is worthy mark helpful and correct!

Thanks,

Pratiksha

View solution in original post

3 REPLIES 3

Kieran Anson
Kilo Patron

Hi D,

Please reference the below products which describes what you need to do .

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/notification/task/t_M...

For second question, update the mentioned mail script to something like

(function runMailScript(current, template, email, email_action, event) {
	template.print('<p><font size="5" color="#808080" face="helvetica"><strong>');
	template.print(gs.getMessage('An incident has been opened on your behalf.'));
	template.print(gs.getMessage('Opened By: ') + current.opened_by.getDisplayValue()); //This line has been added
	template.print('</strong></font></p>');
})(current, template, email, email_action, event);

Pratiksha Kalam
Kilo Sage

Hello,

1.You can create notification on event and add your name in "who will receive"

find_real_file.png

find_real_file.png

 

2.(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {

var task = current.sysapproval.sys_id;
var service = current.sysapproval.hr_service;


email.setSubject(service.getDisplayValue() + ': Approval Required for ' + task_num);
template.print(gs.getMessage('Hello ' + approver.first_name + ',' + '<br />'));
template.print(gs.getMessage('A new HR Case has been created which requires your approval to fulfill.' + '<br />'));

If answer is worthy mark helpful and correct!

Thanks,

Pratiksha

shirin manooche
Giga Contributor

Hello,

What I did:

1. go to "system notification/Email/Notifications"

2. open record "Incident opened for me"

3. on context menu " configure/ form layout"

4. find mandatory and add to right side

5. save 

6. on the form for mandatory field checkmark is true

 

for second part of question

1. go to tab "what it will contain" 

2. in the message.html add opened by from the right side fields

find_real_file.png

 

Also make sure this email is checkmark

find_real_file.png