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

Predefined parameters do not expand variables properly

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins ver. 1.645, plugin version: "2.30", os opensuse/linux

      When chaining multiple jobs by using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

      Example where the first variable gets not expanded in any of the forms below:

      step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

      ---returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

      step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

      ---returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

      step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

      ---returns the same as the second one

      It would be practical to provide the value for TRIGGERED_BUILD_NUMBER with implicit last project name, or add new variable like LAST_BUILD_NUMBER that would provide it.
      Thanks.

          [JENKINS-32583] Predefined parameters do not expand variables properly

          vlad morav created issue -
          vlad morav made changes -
          Description Original: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the variables get not expanded in any form:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME
          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}
          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          Is this intentional?
          New: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the variables get not expanded in any of the forms below, they are returned as strings exactly as they are typed below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME
          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}
          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          Is this intentional?
          vlad morav made changes -
          Description Original: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the variables get not expanded in any of the forms below, they are returned as strings exactly as they are typed below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME
          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}
          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          Is this intentional?
          New: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME
          # returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"
          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}
          # returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"
          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}
          # returns the same as the second one

          Is this intentional?
          vlad morav made changes -
          Description Original: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME
          # returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"
          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}
          # returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"
          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}
          # returns the same as the second one

          Is this intentional?
          New: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

          - returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

          - returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          - returns the same as the second one

          Is this intentional?
          vlad morav made changes -
          Description Original: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

          - returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

          - returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          - returns the same as the second one

          Is this intentional?
          New: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

          ---returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

          ---returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          ---returns the same as the second one

          Is this intentional?
          vlad morav made changes -
          Environment Original: Jenkins ver. 1.645, opensuse/linux New: Jenkins ver. 1.645, plugin version: "2.30", os opensuse/linux
          vlad morav made changes -
          Summary Original: Predefined parameters does not expand New: Predefined parameters do not expand variables properly
          vlad morav made changes -
          Description Original: When chaining multiple jobs and using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

          ---returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

          ---returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          ---returns the same as the second one

          Is this intentional?
          New: When chaining multiple jobs by using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

          ---returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

          ---returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          ---returns the same as the second one

          Is this intentional?
          vlad morav made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          vlad morav made changes -
          Description Original: When chaining multiple jobs by using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

          ---returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

          ---returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          ---returns the same as the second one

          Is this intentional?
          New: When chaining multiple jobs by using the option "Trigger/call builds on other projects", expanding variables in field "Predefined parameters" does not work properly.

          Example where the first variable gets not expanded in any of the forms below:

          step_number=$TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME

          ---returns "$TRIGGERED_BUILD_NUMBER_correct_job_name"

          step_number=${TRIGGERED_BUILD_NUMBER_${LAST_TRIGGERED_JOB_NAME}}

          ---returns "${TRIGGERED_BUILD_NUMBER_correct_job_name}"

          step_number=${TRIGGERED_BUILD_NUMBER_$LAST_TRIGGERED_JOB_NAME}

          ---returns the same as the second one

          Maybe would be enough to provide the value for TRIGGERED_BUILD_NUMBER w

            huybrechts huybrechts
            vmoravec vlad morav
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: