Appreciating any help/guidance:
In a Jira Service Management project (Data Center), we have a third party app that creates tickets in this project via email. The Jira ticket Reporter is setting a generical email from this app and then, we need to change it manually to the right user(email included in the Jira ticket Description when created).
The right output would be to set the right Reporter automatically when the ticket is created(instead of the generical app email).
The idea is to use Scriptrunner, with a Post function in the Create transition to set the right user with this kind of script:
import com.atlassian.jira.component.ComponentAccessor
// the username of the reporter
final String userName = "user_name"
def user = ComponentAccessor.userManager.getUserByName(userName)
issue.setReporter(user)
But first, I need to get the email from the Description field, using a regular expression. I use reggex101 to figure it out:
https://regex101.com/r/7dYFI3/1
"[\w\-][\w\-\.]+@[\w\-][\w\-\.]+[a-zA-Z]{1,4}"i
This regular expression is getting the email, and now I don´t know how to assign it to the username variable.
Since I don´t have the expertise to develop this script with scriptrunner, would be very appreciate it if you guys could help me to achieve this 
Any other workaround is welcome. Cheers