- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 04:08 AM
Hi team ,
I have one requirement where i need the customise subject including short description like mentioned below
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 04:37 AM
Hi @Snehal ,
In order to accommodate in a single email script you will require to get the name of the notification using "email_action" object present in the email script and then put your logic in "if and else" blocks.
Here is a sample code -
if(email_action.name == 'Request was opened') {
var getritm = new GlideRecord('sc_req_item');
getritm.addQuery('request', current.sys_id);
getritm.query();
if (getritm.next()) {
email.setSubject('<div> Request '+ getritm.request.number +' was created - ' + getritm.cat_item.getDisplayValue() +
'</div>');
}
}
else if(email_action.name == 'Request Rejected') {
// put your code to run on this condition
}
else if(email_action.name == 'Request was completed') {
// put your code to run on this condition
}
else {
// your code
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 04:37 AM
Hi @Snehal ,
In order to accommodate in a single email script you will require to get the name of the notification using "email_action" object present in the email script and then put your logic in "if and else" blocks.
Here is a sample code -
if(email_action.name == 'Request was opened') {
var getritm = new GlideRecord('sc_req_item');
getritm.addQuery('request', current.sys_id);
getritm.query();
if (getritm.next()) {
email.setSubject('<div> Request '+ getritm.request.number +' was created - ' + getritm.cat_item.getDisplayValue() +
'</div>');
}
}
else if(email_action.name == 'Request Rejected') {
// put your code to run on this condition
}
else if(email_action.name == 'Request was completed') {
// put your code to run on this condition
}
else {
// your code
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 06:20 AM
Thank You ! Its really helped me .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 06:40 AM