Hi Community,
I am trying to get the email from a issue with:
issue.getReporter().getEmail()
But unfortunately I received an error "cannot find matching method". I need to compare this email address with several domains, followed by specific actions. I saw the syntax above in older groovy versions. Maybe I am just missing a library?
Best,
Kristian
Hello @AccessHolding
This is happens because method really doesnt exist, use
issue.getReporter().getEmailAddress()
ref
https://docs.atlassian.com/software/jira/docs/api/7.1.2/com/atlassian/jira/user/ApplicationUser.html
Hello @Mark Markov,
It works fine.
Do you also know how I can set a static reporter? Currently I receive a string only without a proper relation to the existing user. Screenshot attached. Normally the reporter is set as a link to the person details. But in my case its just a basic string.
issue.reporterId = ComponentAccessor.getUserManager().getUserByName("Noreply")
Thanks for your help Mark,
Best,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to set reported id instead of ApplicationUser object
issue.reporterId = ComponentAccessor.getUserManager().getUserByName("Noreply").getId()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I received the user databse ID with your script. Anyway it helped me, because I changed getId() to .getKey(). Now its fine. Thanks Mark.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.