Sending out emails using the assignee listener

Hi,

We’re dealing with an issue that surely has come up in the past, so we’re hoping there is someone who can point us to the right direction. We’ve implemented a mail service that is triggered using the task assignment listener. Whenever a user that is not assigned completes a task, we must set the assignee before completing the task. However, this triggers our mail service again. The result is that we’re sending out emails every time somebody completes the task. Is there any way around this? Can we set the assignee without triggering the listener somehow?

Thanks in advance for your help!

Can you explain this in more detail? Why is a user that is not assigned to a task completing it?

Hi Naill, thanks for your quick response. We have two cases where a user that is not assigned to a task is completing that task:

  1. User tasks that have been assigned to a group but not to a particular user.
  2. Admin users have the ability to complete tasks that are not assigned to them.

We want to set the assignee so we have a record of who actually completed the task. Perhaps also good to know, we’re looking into the identity link to see if that can be utilized to store this information.

The issue seems to be that if a user claims a task for themselves - there’s no need to send an email?
A solution might be to check the current user before sending the email and only send it if the current user doesn’t match the user who is being assigned to the task.

That’s close, but our usecase is slightly different.

We want to set the assignee as the task is completed for audit purposes. In that case, the task assign listener is triggered that sends out an email notifying the user that they have been assigned to the task they just completed. If they click on the link, they’ll see an error that the task doesn’t exist, which is correct because they just completed it…