How does Folders affect Parameterized Trigger Plugin’s Environment Variables?

Article ID:229377927
1 minute readKnowledge base

Issue

How does Folders affect Parameterized Trigger Plugin’s Environment variables?

What should I use?

Environment

CloudBees Jenkins Enterprise

Parameterized Trigger Plugin

Resolution

The plugin documents following environment variables:

LAST_TRIGGERED_JOB_NAME="Last project started"
TRIGGERED_BUILD_NUMBER_<project name>="Last build number triggered"
TRIGGERED_JOB_NAMES="Comma separated list of all triggered projects"
TRIGGERED_BUILD_NUMBERS_<project name>="Comma separated list of build numbers triggered"
TRIGGERED_BUILD_RESULT_<project name>="Last triggered build result of project"
TRIGGERED_BUILD_RESULT_<project name>RUN<build number>="Result of triggered build for build number"
TRIGGERED_BUILD_RUN_COUNT_project name>="Number of builds triggered for the project"

In this case "<project name>" placeholder is a full name of the project (which includes the folders) with all non-alphanumeric characters replaced by the underscores. For example, if the name of the Project you trigger is Some-Folder/Some-Project, then the variable names are going to be as follows:

TRIGGERED_BUILD_NUMBER_Some_Folder_Some_Project
TRIGGERED_BUILD_NUMBERS_Some_Folder_Some_Project
TRIGGERED_BUILD_RESULT_Some_Folder_Some_Project
TRIGGERED_BUILD_RESULT_Some_Folder_Some_Project_RUN_<build number>
TRIGGERED_BUILD_RUN_COUNT_Some_Folder_Some_Project
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.