jenkinsci / jenkinsci/parameterized-trigger-plugin

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

Open
#655 0 comments 0 reactions 0 assignees View on GitHub
component:parameterized-trigger-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
77
Forks
174
Avg merge
22h 27m
Merged PRs (30d)
1

Description

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.

---
Originally reported by vmoravec, imported from: Predefined parameters do not expand variables properly


  • assignee: huybrechts
  • status: Open
  • priority: Major
  • component(s): parameterized-trigger-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

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.

  • environment: Jenkins ver. 1.645, plugin version: "2.30", os opensuse/linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.