How to get values from a event parameters and use them in a notification

matthew_hughes
Kilo Sage

I'm trying to setup a notification for when a certain catalogue item is completed. The catalogue item contains a list of business application that a user chooses to update. I've created a business rule that triggers the event:

matthew_hughes_0-1736519664875.png

 

I'm trying to use the following code to find any business applications that had been updated at the same time:

matthew_hughes_1-1736519764045.png

However, what I find is that nothing is being returned in the logs even though a business application has been updated through the catalogue item.

 

My email notification is using the Business Application table:

matthew_hughes_2-1736519970202.png

 

What I'm finding is that the ${u_business_owner} and ${department} fields are not getting updated:

matthew_hughes_3-1736520046347.png

If somebody can advise what I need to do to retrieve the values, that would be great.

 

 

 

16 REPLIES 16

JenniferRah
Mega Sage

A couple of things: 

 

First, you don't need the "Updated on today" condition. The business rule runs when it's updated, so that's redundant. 

 

Next, your business rule is running on the RITM (sc_req_item) table, so that's what's in "current". So if your notification is running on a different table, it won't work, because the event is triggered from the RITM.

Hi @JenniferRah ,

 

So both the Event and Notifications have to have the same table?

Technically, they don't have to be, but the fields you will see are based on the table that the notification is triggered off of, but the "current" variable is based off of the table the Event is triggered from. You either have to dot-walk to get to where you want to go or change the notification to run off of the same record.

Juhi Poddar
Kilo Patron

Hello @matthew_hughes 

In addition to input from @JenniferRah  

Try updating the script:

gs.eventQueue('ba.owningorg.update', busApp, busApp.number);

Replace current with busApp.

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar