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"

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • build-user-vars-plugin
    • None
    • Jenkins ver. 1.547

      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.

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

          [JENKINS-27338] Jenkins picking up Middle name of the user as the last name via variable "BUILD_USER_LAST_NAME"

          Even I am facing the same issue.

          Pulkit Agarwal added a comment - Even I am facing the same issue.

          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.

          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.

          Deepak Goel added a comment -

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

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

          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.

          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.

          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

          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

            Unassigned Unassigned
            deepak_goel91 Deepak Goel
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: