How to use 'catalog variables' in conditions or adavanced conditions on email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 03:33 AM
I have written my Notification on sysaproval_approver table. So the catalog variables on RITM table. I am not sure how can I add catalog variables in condition or advanced conditions.
Just assume the catalog variable 'Access' is a Type of Select Box with options prod and non_prod.
So my Notification should be executed if the Access(catalog item variable) is non_prod.
or is it possible by writing script in Advanced condition(under When to send) like below:
var v = current.sysapproval.ref_sc_req_item.variables.access;
answer = v?"true" == v:non_prod;
I tried with above code but the notification is not triggering.
I tried to put some logs:
gs.log(v) is printing- non_admin but when I try to print gs.log(answer)- it's False so that might be the reason.
Kindly help me what was the issue with my script in advanced condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 09:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 09:07 AM
but where are we checking if the type_of_role is non_admin then the notification should trigger?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 08:53 AM - edited 04-03-2024 08:54 AM
@Sarah Bouil Does your who will receive section is empty?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 09:05 AM
Under Who will receive:
Users/Groups: Approver and Groups: SNow Admin
If no Advance condition then Notification is executing and its showing in Email logs
But if I have an Advanced condition, the Notification is not executing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 11:35 PM
Maybe the problem stands in the catalog items value. Check if the value corresponds to the value in the notification advanced script.
I see no reason why it wouldn't work otherwise.