how to add newly created CI link in the notification Workflow activity message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2023 04:15 PM
Hi All,
I have a requirement to add newly created CI link in the notification Workflow activity message, when I preview the email, I dont see the link. Can someone please help me, please, please?
Dear ${requested_for.name}
I hope this message finds you well. We wanted to inform you that ${request.number} request has been successfully processed, and a new application CI has been created.
Best regards,
ServiceNow Team
my variable name is application_name
how to add {URI_REF} for the above link, I tried with the below script on the advanced tab, still no go:
${mail_script:FindtheApplicationLink.URI_REF}- used it in the message
var applicationName = current.variables.application_name;
var gr = new GlideRecord('cmdb_ci_appl');
gr.addQuery('name', applicationName);
gr.query();
while (gr.next()) {
var Applsysid = gr.sys_id;
var sysClass = gr.sys_class_name;
var url = 'https://instancenameservice-now.com/now/nav/ui/classic/' +
'params/target/' + sysClass + '.do?sys_id=' + Applsysid +
'&sysparm_record_target=cmdb_ci_appl' +
'&sysparm_record_row=1&sysparm_record_rows=31482' +
'&sysparm_record_list=ORDERBYname';
template.print('Generated URL: ' + url);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 05:40 AM
Hi,
Is this the complete email script? curly brace '{' is not properly closed for the while loop.
Thank you,
Palani
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 05:59 AM
Hi Palani,
Thank you so much, here is the complete code which I had written, its not working! Can you please help me ?
var applicationName = current.variables.application_name;
var gr = new GlideRecord('cmdb_ci_appl');
gr.addQuery('name', applicationName);
gr.query();
while (gr.next()) {
var Applsysid = gr.sys_id;
var sysClass = gr.sys_class_name;
var url = 'https://instancenameservice-now.com/now/nav/ui/classic/' +
'params/target/' + sysClass + '.do?sys_id=' + Applsysid +
'&sysparm_record_target=cmdb_ci_appl' +
'&sysparm_record_row=1&sysparm_record_rows=31482' +
'&sysparm_record_list=ORDERBYname';
template.print('Generated URL: ' + url);
}
I need to attach newly created CI link in the notification Workflow activity message, when I preview the email, I dont see the link. Can someone please help me, please, please?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 06:00 AM
Hi Palani,
Thank you so much, here is the complete code which I had written, it's not working! Can you please help me ?
var applicationName = current.variables.application_name;
var gr = new GlideRecord('cmdb_ci_appl');
gr.addQuery('name', applicationName);
gr.query();
while (gr.next()) {
var Applsysid = gr.sys_id;
var sysClass = gr.sys_class_name;
var url = 'https://instancenameservice-now.com/now/nav/ui/classic/' +
'params/target/' + sysClass + '.do?sys_id=' + Applsysid +
'&sysparm_record_target=cmdb_ci_appl' +
'&sysparm_record_row=1&sysparm_record_rows=31482' +
'&sysparm_record_list=ORDERBYname';
template.print('Generated URL: ' + url);
}
I need to attach newly created CI link in the notification Workflow activity message, when I preview the email, I dont see the link. Can someone please help me, please, please?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 06:01 AM
Here is the complete script:
var applicationName = current.variables.application_name; var gr = new GlideRecord('cmdb_ci_appl'); gr.addQuery('name', applicationName); gr.query(); while (gr.next()) { var Applsysid = gr.sys_id; var sysClass = gr.sys_class_name; var url = 'https://instancenameservice-now.com/now/nav/ui/classic/' + 'params/target/' + sysClass + '.do?sys_id=' + Applsysid + '&sysparm_record_target=cmdb_ci_appl' + '&sysparm_record_row=1&sysparm_record_rows=31482' + '&sysparm_record_list=ORDERBYname'; template.print('Generated URL: ' + url); }
Please help me bro