Notification not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 05:08 AM
Hey Everyone,
I am trying to trigger a notification through background script using event, but email is not triggering, when i checked the event log i can see event has triggered but not sure why it is in ready state every time when i try to trigger. Please see the screenshot. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 08:41 PM
Hi.
Take a look at the "email_diagnostics" table.
I don't think PDI offers the ability to send emails.
Mark Helpful if you accept the solution.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 09:01 PM
I couldn't see any recipient in event table
Are you sure recipient is set correctly?
Is this for your customer instance or PDI?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 02:28 AM
This is customer instance, and I am trying to send a notification to a user with the list of custom fields which has no value in all records, I am testing the notification using background script before putting in schedule job. Below are the background script and screenshots of notification.
var tableName = ['sn_grc_issue', 'sn_grc_task', 'sn_audit_engagement'];
for (var i = 0; i < tableName.length; i++) {
var fieldArr = [];
var dictionaryGR = new GlideRecord('sys_dictionary');
dictionaryGR.addEncodedQuery('elementSTARTSWITHu_^active=true^name=' + tableName[i]);
dictionaryGR.query();
gs.info(dictionaryGR.getRowCount());
while (dictionaryGR.next()) {
checkUnusedField(tableName[i], dictionaryGR.element, dictionaryGR.column_label);
}
gs.info("Un-used fields on table " + tableName[i] + " are " + fieldArr);
if (fieldArr.length > 0) {
gs.info("inside if");
gs.eventQueue('unused_field_event', dictionaryGR, tableName[i], fieldArr);
}
}
function checkUnusedField(table, field_name, field_label) {
var tableGr = new GlideRecord(table);
tableGr.addEncodedQuery('' + field_name + '!=NULL');
tableGr.query();
if (tableGr.getRowCount() == 0) { //field has empty value in all records
fieldArr.push(field_label + " ");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 04:32 AM
did the event get processed?
Did it trigger email log record and did you check that user has email populated and is active and not locked out and has notification preference enabled on profile?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader