- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2025 12:54 PM
Hi, I am trying to trigger an event inside of a BR that will send a notification to the task primary owner if a label/tag containing "planned" is added to a VTB card on Visual Task Board. The event/email is not getting triggered whenever I make a change on the VTB. Could anyone review the following:
I set up a BR to run on vtb_card table, After, insert
My event and the notification are also running on vtb_card and the notification will get sent to the task.primary_contact.
Business Rule:
Condition: Board = Team Name
(function executeRule(current, previous /*null when async*/ ) {
var labelEntryGR = new GlideRecord('label_entry');
labelEntryGR.addQuery('table', 'vtb_card');
labelEntryGR.addQuery('table_key', current.sys_id);
labelEntryGR.query();
while (labelEntryGR.next()) {
var labelGR = new GlideRecord('label');
if (labelGR.get(labelEntryGR.label.sys_id)) {
if (labelGR.name.indexOf('planning') !== -1) {
var cardGR = new GlideRecord('vtb_card');
if (cardGR.get(labelEntryGR.table_key)) {
gs.eventQueue('myevent, cardGR);
}
}
}
}
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2025 11:07 PM
@user034972342 - Please add logger to understand the value you are receiving as a labelGR.name and check. Code looks good to me, I assume you have register the required event "myevent" on the table vtb_card.
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2025 11:07 PM
@user034972342 - Please add logger to understand the value you are receiving as a labelGR.name and check. Code looks good to me, I assume you have register the required event "myevent" on the table vtb_card.
Thanks & Regards,
Vasanth