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

Jenkins picking up Middle name of the user as the last name via variable "BUILD_USER_LAST_NAME"

    Details

    • Similar Issues:

      Description

      I am using Google Login Plugin v1.1

      My script is

      echo Build User : $BUILD_USER
      echo First Name : $BUILD_USER_FIRST_NAME
      echo Last Name : $BUILD_USER_LAST_NAME
      echo Build User ID : $BUILD_USER_ID

      and output is

      Build User : Gurpreet Singh Bawa
      First Name : Gurpreet
      Last Name : Singh
      Build User ID : gurpreet.bawa@snapdeal.com

      The last name should be picked as "Bawa" and not "Singh"
      I am not able to find a way to take "Bawa" as the Last Name. Please help me here.

        Attachments

        1. 1.png
          1.png
          201 kB
        2. 2.png
          2.png
          224 kB

          Activity

          Hide
          pulkit Pulkit Agarwal added a comment -

          Even I am facing the same issue.

          Show
          pulkit Pulkit Agarwal added a comment - Even I am facing the same issue.
          Hide
          danielbeck Daniel Beck added a comment -

          Jenkins has no way to distinguish between first name and last name.

          Given how many variants exist (multiple first names, multiple last names, etc.) there's no way this plugin can get these right. I recommend you just don't use this misguided feature.

          Show
          danielbeck Daniel Beck added a comment - Jenkins has no way to distinguish between first name and last name. Given how many variants exist (multiple first names, multiple last names, etc.) there's no way this plugin can get these right. I recommend you just don't use this misguided feature.
          Hide
          deepak_goel91 Deepak Goel added a comment -

          Hi Daniel, can you please tell me any other way to determine the Build User's Last name?

          Show
          deepak_goel91 Deepak Goel added a comment - Hi Daniel, can you please tell me any other way to determine the Build User's Last name?
          Hide
          danielbeck Daniel Beck added a comment -

          This cannot be reliably determined within Jenkins, as Jenkins has only the single input field "Full Name" rather than separate "First Name" and "Last Name" fields. The Build User Vars Plugin implements a hack that cannot deal with multiple first and/or last names, as you can see.

          Show
          danielbeck Daniel Beck added a comment - This cannot be reliably determined within Jenkins, as Jenkins has only the single input field "Full Name" rather than separate "First Name" and "Last Name" fields. The Build User Vars Plugin implements a hack that cannot deal with multiple first and/or last names, as you can see.
          Hide
          pixman20 pixman20 added a comment -

          I am running into a similar situation where our name format is:
          LastName, FirstName
          So they are switched.

          I recommend using $BUILD_USER and simply parsing it on your own.
          You can use the plugins such as the env-inject plugin to script it out in groovy and set an environment variable appropriately

          Show
          pixman20 pixman20 added a comment - I am running into a similar situation where our name format is: LastName, FirstName So they are switched. I recommend using $BUILD_USER and simply parsing it on your own. You can use the plugins such as the env-inject plugin to script it out in groovy and set an environment variable appropriately

            People

            • Assignee:
              Unassigned
              Reporter:
              deepak_goel91 Deepak Goel
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: