Send Email Based off of A Catalogue Variable

jstoneiii
Kilo Expert

I need to send an email notification - based on a name that is populated on a Task. The Task originated from the Service Catalogue.

My first idea was just to copy that variable into a field on a Task form and use that Field to trigger a notification. Not much luck there. I can't get the variable to copy from the Request to the Task.

Do I keep trying to copy that variable into a field on the Task form? If so how?

or

Can I use that variable as a send to via an email notification?

Any help is welcomed!

7 REPLIES 7

benn23
ServiceNow Employee
ServiceNow Employee

Give it a shot, I think you'll be pleasantly surprised.


You have access to the variables via the 'current.variables.xxx' method.


Ideally what I would like to do is copy the variable using the Advanced check box from the Requested Item Variable which is submitted by the Request to the SC Task. That is ideal for what I want to accomplish.


I think what you are saying is you want a field populated on the SC task from the items workflow?


If that is the case, you would use task.<your field name> = current.variables.<variable name>; in the advanced script box on the catalog task workflow activity.



Something like this


task.assigned_to = current.variables.assigned_to;



task refers to the task you are creating and current.variables refers to the RITM variables(remember, variables are related to the item and not the request).


You could then trigger the email from that field on the task.