Sergey Grigoriev edited a comment on Bug JENKINS-16332

I have run a script in Jenkins console

import java.util.logging.Logger
import java.util.logging.Level;
import hudson.model.*
import hudson.plugins.emailext.EmailRecipientUtils  
import hudson.tasks.MailAddressResolver  
import hudson.model.User  
  
def mailAddressResolverLogger = Logger.getLogger(MailAddressResolver.class.getName());
mailAddressResolverLogger.setLevel(Level.FINE)


def job = Hudson.instance.getJob("sms-dev-jdk7");  
def build = job.getBuild("46")

build.culprits.each {   
  def userMailProp = it.properties.find { it.toString().contains('Mailer') }.value	
  println "${it.id} -- ${userMailProp.address}"  
}

it prints

Igor Ivanov _igor12345@yahoo.com_ -- igor1...@yahoo.com
John Doe  _dev@xyz.com_ -- John Doe  _dev@xyz.com_

So the user object for which Jenkins uses a wrong email, has a different value for email than normal users, see hudson.tasks.Mailer.UserProperty#getAddress.
For normal users getAddress returns email, while for John Doe not email, but user's id is returned.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to