Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47914

Use Jenkins user id instead of user name as buildUser

      Hi Naresh,

       

      I'm facing a (really) small issue with the plugin:

      My JIRA server and Jenkins server are sharing the same users IDs, but users IDs and display names are different ('jdoe' as ID and 'John DOE' as display name for instance).

      Is there a specific reason you used the UserIdCause.getUserName() instead of UserIdCause.getUserId() to compute the buildUser?

      Is it possible to change it? (or maybe make it configurable at least?)

       

      JiraStepExecution.java - ligne 136

      buildUser = ((UserIdCause) causes.get(0)).getUserId();
      

      Just made this small change and it worked well for me (for steps I tested: jiraAddComment, jiraNewVersion).

       

      Comment with Jenkins user name:

      Comment with Jenkins user ID:

      What do you think?

       

      P.S. Thanks a lot for this plugin by the way, it's helping me a lot 

       

          [JENKINS-47914] Use Jenkins user id instead of user name as buildUser

          Naresh Rayapati added a comment - - edited

          +1, I didn't realize this as userName and userId are same on my local Jenkins instance. For now I will update it to use UserId instead and also will think of this as a configurable in future when I have situation where this differs. Thanks for reporting this paldari

          Naresh Rayapati added a comment - - edited +1, I didn't realize this as userName and userId are same on my local Jenkins instance. For now I will update it to use UserId instead and also will think of this as a configurable in future when I have situation where this differs. Thanks for reporting this paldari

          Naresh Rayapati added a comment - PR:  https://github.com/jenkinsci/jira-steps-plugin/pull/51

          I have merged the changes in, I will cut the new tag after further verification. Thanks. 

          Naresh Rayapati added a comment - I have merged the changes in, I will cut the new tag after further verification. Thanks. 

          Released 1.2.5, should be available soon in the update center. 

          Thanks again paldari for reporting. 

          Closing this JIRA now. 

          Naresh Rayapati added a comment - Released 1.2.5, should be available soon in the update center.  Thanks again paldari for reporting.  Closing this JIRA now. 

          Kevin Darne added a comment -

          Wow, thank you for the quick reaction

          Kevin Darne added a comment - Wow, thank you for the quick reaction

            nrayapati Naresh Rayapati
            paldari Kevin Darne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: