- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018 04:06 AM
Hi Team,
I have configured an email notification on RITM table,would like to populate Task number in notification subject.There is an existing post , I could not find an answer. So please help me.
Regards,
Saridha.L
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018 06:57 AM
as everybody already informed, you need to use email API setSubject to set the email subject with task number but just wanted to add one thing here is, setSubject will replace the whole email subject so if you want to put Task number along with other other email subject content then you can use the code provided by bhagya1764 by updating the below line of code.
email.setSubject(gr.number + ' : ' + 'YOUR REST OF THE EMAIL SUBJECT TEXT');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018 04:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018 04:29 AM
To display a catalog task write below script in email notification script and add the script in the notification BODY.
var gr=new GlideRecord("sc_task");
gr.addQuery("request_item",current.sys_id);
gr.query();
if(gr.next()){
email.setSubject("Task Number"+gr.number);
}
The above script will only display single catalog task.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018 06:57 AM
as everybody already informed, you need to use email API setSubject to set the email subject with task number but just wanted to add one thing here is, setSubject will replace the whole email subject so if you want to put Task number along with other other email subject content then you can use the code provided by bhagya1764 by updating the below line of code.
email.setSubject(gr.number + ' : ' + 'YOUR REST OF THE EMAIL SUBJECT TEXT');