Unable to locate current JTA transaction

I have a Groovy script that searches for users with a role in a group.
It works on the IDE and in some cases in runtime.
But sometimes it raises org.bonitasoft.engine.identity.SGroupNotFoundException, even when the group exists.
It also raises Unable to locate current JTA transaction exception.

Looks like a bug in the server, since the same code works on the IDE.
Any suggestion?

None. I would submit a bug report on Atlassian if I were you,

regards
Seán

PS: If this reply answers your question, please mark as resolved.