BR notification on Visual task boards - new label

user034972342
Tera Contributor

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);

 

1 ACCEPTED SOLUTION

@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

View solution in original post

5 REPLIES 5

@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