Is it possible to trigger a notification for task assignee as soon as a tag is added to the task?

Pooja Gupta
Tera Contributor

Hi All,

 

I have a requirement to trigger notification to task assignee whenever a particular tag is added to any record in the task table. Is it possible?

1 ACCEPTED SOLUTION

Arav
Tera Guru
Tera Guru

Hi,

 

Yes, it is possible. Task - tag assignments are saved in label_entry table and you could write an "after insert BR" on that table to send a notification.

 

But please evaluate the performance implications before implementing this. Think of scenarios like "What if someone adds a tag to multiple tasks from list view in one go ?"

 

Thanks,

Arav

View solution in original post

3 REPLIES 3

Arav
Tera Guru
Tera Guru

Hi,

 

Yes, it is possible. Task - tag assignments are saved in label_entry table and you could write an "after insert BR" on that table to send a notification.

 

But please evaluate the performance implications before implementing this. Think of scenarios like "What if someone adds a tag to multiple tasks from list view in one go ?"

 

Thanks,

Arav

Anish Reghu
Kilo Sage
Kilo Sage

@Pooja Gupta 

 

 

Yes, it's possible to trigger a notification to the task assignee whenever a particular tag is added to any record in the task table. Here's one way you can accomplish this:

  1. Create a Business Rule on the task table that runs when a tag is added.

  2. In the Business Rule's Condition, specify the tag that should trigger the notification.

  3. In the Business Rule's Action, you can use the gs.eventQueue() function to send a notification to the task assignee. The gs.eventQueue() function allows you to send an event message to a specific user, group, or role.

Here's an example of how you can use the gs.eventQueue() function in a Business Rule script:

 

// Get the task assignee
var taskAssignee = current.assigned_to;

// Send a notification to the task assignee
gs.eventQueue('notification.tag.added', current, taskAssignee, taskAssignee);

 

 

  1. Create a notification script that will listen for the notification.tag.added event and send the notification to the task assignee.

  2. In the notification script, you can use the gs.sendEmail() function to send an email to the task assignee, or use the gs.event() function to send a notification to the task assignee's device.

 

Kindly mark the response as Correct or Helpful.

Cheers,

Anish

Hi Anish, 

 

Thank you for your response.

The BR doesn't seem to run when adding a condition to run when a specific tag is added. Should I be doing it differently?

 

PoojaGupta_0-1673923704270.png