Get user assigned to a task


hi all,

how can I get user assigned to a task with script groovy,

I want to get user to send an email to him, that his is assigned to a task,

i use email connector.

How can I do that with script groovy,

Thanks in advance

1 answer



In the Studio, you will find pre-defined variables. Among them, you'll see the taskAssigneeId.

To retrieve the professional email for the assignee in a groovy script, you could proceed with something like that:

// Start code

import org.bonitasoft.engine.identity.User;
import org.bonitasoft.engine.identity.ContactData;
import org.bonitasoft.engine.identity.UserWithContactData;
import java.util.logging.Logger;

Logger logger = Logger.getLogger("org.bonitasoft");

final UserWithContactData assigneeWithProfessionalDetails = apiAccessor.identityAPI.getUserWithProfessionalDetails(taskAssigneeId);

ContactData assigneeContactData = assigneeWithProfessionalDetails.getContactData();

String assigneeProfessionalEmail = assigneeContactData.getEmail();"Assignee Professional Email is: " + assigneeProfessionalEmail);

return assigneeProfessionalEmail;

// End code

I invite you to consult the Javadoc for the identity API here:

I hope it helps,




Submitted by merikawasselin_... on Thu, 01/02/2020 - 07:09

hi, thanks for your replay,

taskAssigneeId is not known;

my screenplay,
I have a task (prepare coffee) , this task is connected to timer, and a service type task to send a mail to the person assigned to the task (prepare coffee) to tell him that you are assigned to the task (prepare coffee).

what I'm trying to do is, to get the user assigned to task (prepare coffée) and send him an email

Submitted by merikawasselin_... on Fri, 01/03/2020 - 06:28

is there a way to find out who is assigned to a specific task with a groovy script:

Something like this:

..... getAssignedHumanTask ("HumanTask name",...)

Submitted by delphine.coille... on Fri, 01/03/2020 - 16:39


as there is a technical issue with this question and you can't see Marielle's answer, I will copy it in your other related question in french :