# How can I retrieve the initiator's id and his/her email using a groovy script?

**URL:** <https://community.ofelia.com/t/how-can-i-retrieve-the-initiators-id-and-his-her-email-using-a-groovy-script/7795>\
**Category:** Q&A\
**Created:** [18 September 2016 21:03 UTC](https://community.ofelia.com/t/how-can-i-retrieve-the-initiators-id-and-his-her-email-using-a-groovy-script/7795 "2016-09-18T21:03:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![javier.cifuentes\_1](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@javier.cifuentes\_1](https://community.ofelia.com/u/javier.cifuentes_1)\
**Post date:** [18 September 2016 21:03 UTC](https://community.ofelia.com/t/how-can-i-retrieve-the-initiators-id-and-his-her-email-using-a-groovy-script/7795/1 "2016-09-18T21:03:56Z")

</div>

Hi there. I’m trying to retrieve the initiator’s id and email using this groovy script:

import org.bonitasoft.engine.identity.ContactData;  
import org.bonitasoft.engine.bpm.process.ProcessInstance;  
return(ContactData.getEmail(ProcessInstance.getStartedBy()));

But I get this error in the log:

groovy.lang.MissingMethodException: No signature of method: static org.bonitasoft.engine.bpm.process.ProcessInstance.getStartedBy() is applicable for argument types: () values:

Any hint is very much appreciated. Level:Beginner.

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [19 September 2016 02:27 UTC](https://community.ofelia.com/t/how-can-i-retrieve-the-initiators-id-and-his-her-email-using-a-groovy-script/7795/2 "2016-09-19T02:27:18Z")

</div>

`
import java.util.logging.Logger;
Logger logger= Logger.getLogger("org.bonitasoft");
logger.severe(“\tgetUser”);
String usergetProcessInstanceInitiatorPersonalContactInfo = BonitaUsers.getProcessInstanceInitiatorPersonalContactInfo(apiAccessor,processInstanceId).getEmail();
logger.severe("\tgetUser personal email = " + usergetProcessInstanceInitiatorPersonalContactInfo);
String usergetProcessInstanceInitiatorProfessionalContactInfo = BonitaUsers.getProcessInstanceInitiatorProfessionalContactInfo(apiAccessor,processInstanceId).getEmail();
logger.severe("\tgetUser professional email = " + usergetProcessInstanceInitiatorProfessionalContactInfo);
`

`return “whichever you need”;
`

regards  
Seán

_PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply._

**PPS**

**A Tip on displaying CODE/LOGS correctly in Posts:**

Do not use the Supplied Buttons above, for some reason they refuse to work correctly, and despite bringing it to Bonitasofts attention, it’s low priority.

_To Show Code/Logs correctly use_

\< code \>  
your code/log  
\< /code \>

removing the spaces to allow the showing of code/logs correctly as here:

`
your code/log
`

Thanks and regards  
Seán

---

<div class="post-metadata">

**Author:** ![javier.cifuentes\_1](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@javier.cifuentes\_1](https://community.ofelia.com/u/javier.cifuentes_1)\
**Post date:** [19 September 2016 16:03 UTC](https://community.ofelia.com/t/how-can-i-retrieve-the-initiators-id-and-his-her-email-using-a-groovy-script/7795/3 "2016-09-19T16:03:15Z")

</div>

Thanks for your quick answer Seán.

It works flawlessly. Are there any methods to retrieve user’s custom data in a similar way? I tried fruitlessly to find them using the api documentation.

Thanks again.

Javier

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [19 September 2016 20:53 UTC](https://community.ofelia.com/t/how-can-i-retrieve-the-initiators-id-and-his-her-email-using-a-groovy-script/7795/4 "2016-09-19T20:53:27Z")

</div>

In Javadocs here: [http://documentation.bonitasoft.com/javadoc/api/7.3/index.html](http://documentation.bonitasoft.com/javadoc/api/7.3/index.html)

there are lots of methods such as **getCustomUserInfo** which might help you,

regards  
Seán
