Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Notification recipient based on condition

Tadz
Kilo Sage

Hi is it possible to make a dynamic recipient for a notification.

For example: (Notification Email Script)

if(condition)

        notify group A

else

        notify group B

is this possible?

I was thinking of using the addAddress(String type, String address, String displayname): type can be cc or bcc.

but there is no to

I was also thinking maybe I can use the recipient_fields in the notifications table.

Example

recipients_fields = group_sys_id;

Does anyone have an idea?

Thanks,

Tadz

2 REPLIES 2

Jon Barnes
Kilo Sage

Another option is to calculate your recipient in a business rule and use gs.eventQueue to trigger the notification via the event.



you can pass the calculated recipient in as parm1.



let me know if this makes sense or I can give you some more details tomorrow.



Thanks Jonathan Barnes, I was hoping it can be achieve using Notification Email Script.


But if there's no other way then I'll use that approach.



Thanks a lot!



Tadz