Business Rule not working on Visual Task Board Card table when order is changed from the VTB

Romulus Rodrigu
Tera Expert

Hello guys,

Ok, here is one I can’t figure out. I have requirements to have two VTBs one that shows active Enhancements assigned to a specific group; the other one shows Stories in which the Enhancement field is not empty and that are assigned to the same group (This two VTB I have already configured).

Now what needs to happen is that when an enhancement gets re-order (moved up or down the lane) in the Enhancement VTB the related story/s will get the same order in the Enhancement Story VTB.

So far I created a BR on the vtb_card table that will update the order filed for the story card from the enhancement card when the order field changes on the enhancement card. It works fine from the vrb_card table but when I change the order on the actual VTB board the BR does not trigger.

What am I missing?

 

BR:

Table: vrb_card

When: after

  Update:true

Filter Condition: Order, changes

Script:

(function executeRule(current, previous /*null when async*/) {

                 var syncEnSt = new GlideRecord("vtb_card");

                                syncEnSt.addQuery("task.ref_rm_story.enhancement.number", current.task.number);

                                syncEnSt.query();          

                if(syncEnSt.next()){

                                syncEnSt.order = current.getValue('order');

                                syncEnSt.update();

                }

 

 

 

 

})(current, previous);

 

4 REPLIES 4

Manish Vinayak1
Tera Guru

Hi Romulus,

I tried creating a simple business rule which created system logs on change of order field. Even I observed that the business rule doesn't trigger if you update the Order from the Visual Task Board. I tried removing the condition as well, it was set to trigger on update of the record, even then it didn't trigger if the order was changed from Visual Task Board.

Then I thought maybe there is any event which is getting triggered on doing that, which could be utilized to write a script action to work on the event, and sync the order on other task board. But no luck there, I didn't find any event getting triggered.

I assume the background logic which changes the order has the "setWorkflow(false)" call; maybe it doesn't trigger any business rules.

My alternative approach to deal with it would be, maybe:

  • create a UI Action with List Context Menu type or List Action type, which could be triggered to sync the order between the Taskboards

or

  • create an on demand scheduled script to sync the Order value between the Task Boards

But maybe hopefully you find a way to get that business rule triggered 🙂

Hope this helps!

Thanks,

Manish

Thank you Manish for your suggestion and for taking the time and trying it out. The ideal scenario is for the VTBs cards to be in sync as soon as order changes on one of them but I am going to make some consideration to the scheduled job you suggested, maybe I can run it every minute to get them in sync.

I also opened a case with Service Now see if they can tell me the reason for the BR to not be triggered by the VTB.

Harish KM
Kilo Patron
Kilo Patron

Hi you can dot walk only up to 3 fields but I can see you have more than 3 in below query

syncEnSt.addQuery("task.ref_rm_story.enhancement.number", current.task.number);

NOTE:The recommended limit for chain length is three levels.

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/use/navigation/concept/c_DotWalking.html

Regards
Harish

Thank you harish,

I am dot walking three feels down, I am just jumping into the rm_story table to by using ref to grab the number field. The script works the issue is that the BR is not getting triggered by the changes made on the VTB.

But thank you for your help!