- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 05:03 AM
Hi All,
Requirement : A notification needs to be triggered when ever a automation case gets created, this table is a custom table which extends the task table and it should be below format.
Dear Requestor,
Your Case has been opened: <Automation number>.
Your list of Automation Cases is accessible here <link>.
---This is automated alert mail from automated mailbox, please do not answer ---
Best Regards
Automations.
Here in the notification, I have to provide a link which have the list of Automation cases raised for that particular user (requested for should be that user). I'm not sure how to achieve this. Can anyone please guide me on this.
Thanks in Advance,
Nagashree.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 06:51 AM
Hello @Nagashree5
To make a clickable hyperlink via a notification script, refer to the example below:
sample notification script:
(function runMailScript(current, template, email, email_action, event) { // Build the link format var attachLink = '<a href=/sp?id=ticket&sys_id=' + current.sys_id; attachLink += '&table=' + current.getRecordClassName(); attachLink += '>Portal</a>'; // Print the link text template.print(attachLink); })(current, template, email, email_action, event);
And yes. Triggering the email when the event is fired is the best approach in such scenarios.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 05:52 AM
Hi @Nagashree5
You can get the backend value of the number field by checking the dictionary of the table.
Since it is extended from task table, am assuming it will be 'number'
For the list of cases, you can write a notification script where the list is populated.
A sample of an notification script to generate an URL is as below:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var sid = current.variables.select_group;
var url = gs.getProperty('glide.servlet.uri') + 'incident_list.do?sysparm_query=active=true^assignment_group=' + sid;
template.print(url + "<br />");
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 01:53 AM
Hi @SatyakiBose ,
Thanks for the response. In the above code, for sid - current.variables.select_group is mentioned. Do I need to change it to assignment_group?
Also, could you please let me know how can I fire this event. Do I need to create a BR to fire the event?
Could you please guide me.
Thanks,
Nagashree.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 01:58 AM
Hi @SatyakiBose ,
Thanks for the response.
I have written the email script like below.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var sid = current.variables.assignment_group;
var url = gs.getProperty('glide.servlet.uri') + 'x_932770_gbs_gbs_case_list.do?sysparm_query=active=true^assignment_group=' + sid;
template.print(url + "<br />");
})(current, template, email, email_action, event);
And I have created the Notification like below.
${mail_script:listofgbscases}
Dear Assigned to: ${assigned_to},
Your Case has been opened: Number: ${number}.
Your list of Automation Cases is accessible here url.
---This is automated alert mail from automated mailbox, please do not answer ---
Best Regards
Automations.
I have called the email script in the notification like above, How do I place the URL in the list of automation cases above in the notification, Also, do I need to create an event and BR to trigger this. Could you please guide me .
Thanks so much,
Nagashree.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 02:01 AM
Hi @SatyakiBose ,
Thanks for the response.
I have written the email script like below.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var sid = current.variables.assignment_group;
var url = gs.getProperty('glide.servlet.uri') + 'x_932770_automation_case_list.do?sysparm_query=active=true^assignment_group=' + sid;
template.print(url + "<br />");
})(current, template, email, email_action, event);
And I have created the Notification like below.
${mail_script:listofautomationcases}
Dear Assigned to: ${assigned_to},
Your Case has been opened: Number: ${number}.
Your list of Automation Cases is accessible here url.
---This is automated alert mail from automated mailbox, please do not answer ---
Best Regards
Automations.
I have called the email script in the notification like above, How do I place the URL in the list of automation cases above in the notification, Also, do I need to create an event and BR to trigger this. Could you please guide me .
Thanks so much,
Nagashree.