Getting the values of variables in a mail script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 01:03 AM
I've got the below mail script that current runs off a notification in the 'cmdb_ci_business_app' table. I want it to show the list of devices where the mentioned user in the notification is the 'Divisional Application Owner'. My script is below:
if (current.u_business_owner.active == false || current.u_custodian.active == false || current.u_cmdb_data_steward.active == false)
template.print('<p>Click '); template.print('<a href="https://' + gs.getProperty('instance_name') + '.service-now.com' + '/cmdb_ci_business_app_list.do?sysparm_query=u_business_owner%3D" + current.u_business_owner + "&sysparm_first_row=1&sysparm_view=business_application_readonly" >'+ 'HERE'+'</a>'); template.print(' to view the list of Business Applications they are aligned to.</p>');
However, when I run the notification, the link appears to show the 'Divisional Application Owner' field as empty rather than running against the affected user:
I'm trying to get the sys ID of the current 'Divisional Application Owner' and put that in my query. I'm trying to do this with 'current.u_business_owner', but do I need to do it another way?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 02:49 PM
Hello Matthew,
Try this see if it works better:
if (current.u_business_owner.active == false || current.u_custodian.active == false || current.u_cmdb_data_steward.active == false) {
template.print('<p>Click ');
template.print('<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/cmdb_ci_business_app_list.do?sysparm_query=u_business_owner%3D' + current.u_business_owner + '&sysparm_first_row=1&sysparm_view=business_application_readonly" >' + 'HERE' + '</a>');
template.print(' to view the list of Business Applications they are aligned to.</p>');
}