- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 02:21 AM
Hi All, I have below requirement for creating different email notifications to a catalog item "ABC"
Req:1
I want sent a email notification like below template to the requester
Email1: Email upon submittal. To: Requester, Trigger: Submittal of completed (all mandatory fields populated) property removal form
Req 2: I want sent mail to the infrastructure owner(Variable in catalog item)
Email2: Please approve or reject. To: Infrastructure Owner, Trigger: Submittal of completed (all mandatory fields populated) property removal form
Req:3
i want sent mail to the approvers in Ritm form
Email: Please approve or reject. To: Next approver in the workflow , Trigger: Approval by the previous approver
Req:4
I want sent mail to All approvers
Email4: Approval. To: Requester. Trigger: All approver have approved the request.
Req:5
I want sent a mail to requester if approval is rejected
Email5: Rejection To: Requester. Trigger: One approver has rejected the request
How to acheive above the requirements can any one please post some script for this
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 02:27 AM
Go to Notifications and start configuring for each of those points.
Let me know if you have any questions.
Mark the comment as helpful if it helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 06:54 AM
what is number()?
If its a viarable name, then just print variable. why are you printing as if its a function.
gr.variables.number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 06:57 AM
here number means ritm nunber. like below
Property removal identifier (RITM):RITM0247057
Requester: Arjun
Requested date: 2019-03-25 09:49:36 EDT
Can device be destroyed?:No
Site:ATC
Device Type:Hard Drive(s)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 07:04 AM
Hi Nag,
Number is directly available under RITM. It is not in variables.
Please check what values you wanted to access and where they exist in RITM. Open any RITM and you will understansd whether they exist under variables in RITM or directly in RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 07:11 AM
i tried for two print statement
template.print("Property removal identifier (RITM):" + gr.number() + '<br/> <br/>');
template.print("Device Recipient Name:" + gr.varaiables.Recepient_name_reference() + '<br/> <br/>');
output is coming like below;
Property removal identifier (RITM):undefined
Device Recipient Name:undefined
Ritm screen shot
Modified code
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', current.sysapproval);
gr.query();
while(gr.next()) {
{
template.print("Property removal identifier (RITM):" + gr.number() + '<br/> <br/>');
template.print("Device Recipient Name:" + gr.varaiables.Recepient_name_reference() + '<br/> <br/>');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 07:14 AM
Your variables spelling is wrong.
gr.variables.Recepient_name_reference
and for number, access
gr.number