how to create different email notifications for a catalog item

Nag9
Tera Expert

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

 

 

find_real_file.png

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

 

find_real_file.png

 

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

find_real_file.png

 

Req:4 

I want sent mail to All approvers

Email4: Approval. To: Requester. Trigger: All approver have approved the request.

find_real_file.png

 

Req:5 

I want sent a mail to requester if approval is rejected

Email5: Rejection To: Requester. Trigger: One approver has rejected the request

find_real_file.png

 

How to acheive above the requirements can any one please post some script for this

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

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.

View solution in original post

25 REPLIES 25

what is number()?

If its a viarable name, then just print variable. why are you printing as if its a function.

gr.variables.number

 

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)

 

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.

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/>');

Your variables spelling is wrong.

gr.variables.Recepient_name_reference

 

and for number, access

gr.number