- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 06:30 PM
Hi,
I need to display a custom variable defined in sc_request table for my SLA notification. The custom variable is u_service_category. Can you give me an example how this can be accomplished? I am new to Service Now and any help will be greatly appreciated.
Thanks,
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2019 01:32 PM
Hi Arnab,
I logged into your instance and took a look around, I changed a few things and all of those updates are captured in the update set named "Test request sla" so it is easier for you to see what was changed, essentially.
1) There was not an SLA definition in the developer instance so I created one for the Request table.
2) I added "SLA" related list to the request form so I can see if SLA task is created.
3) I made some changes to the fields in the notification to get the correct values, I did not make any changes to the mail script you have in there, it printed out the correct value already without any changes needed.
Please take a look at these two emails, do they have all the information you needed? https://dev63739.service-now.com/sys_email_list.do?sysparm_query=sys_created_onONToday%40javascript%3Ags.beginningOfToday()%40javascript%3Ags.endOfToday()%5Esubject%3DSLA%20WARNING
Let me know if you have any questions 🙂
Thanks,
Phuong

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 06:41 PM
If your notification is created on sc_request table then use the below
template.print(" Service Category " + current.u_service_category) ;
-satheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 06:58 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 07:08 PM
It seems you have used email scripts to fetch that value.
We need to check that script to find the issue Can you share the code of that script,
System Notifications > Email > Notification Email Script,> search for sla_request_sc and share the code
-satheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 07:19 PM
Hi Satheesh,
It is the same code which you provided. Thanks
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
template.print(" Service Category " + current.u_service_category);
})(current, template, email, email_action, event);