jenkinsci / jenkinsci/workflow-cps-plugin
[JENKINS-68720] Jenkins Pipeline set environmental variable empty if there already same variable name defined
- Dominant language
- Java
- Stars
- 186
- Forks
- 213
- Avg merge
- 12h 12m
- Merged PRs (30d)
- 8
Description
In pipleline job, when setting a variable like:
environment
{
dc = "20"
}
At the same time, if there is global variable defined

The problem is, the "dc" variable can not be used (found) in pipeline shell environment variable. However if variable use uppercase like "DC", it can be used.
---
Originally reported by yaoyao, imported from: Jenkins Pipeline set environmental variable empty if there already same variable name defined
Raw content of original issue
In pipleline job, when setting a variable like:
environment
{dc = "20"
}
At the same time, if there is global variable defined
The problem is, the "dc" variable can not be used (found) in pipeline shell environment variable. However if variable use uppercase like "DC", it can be used.
1 attachment
- [image-2022-06-09-16-27-10-256.png](https://issues.jenkins.io/secure/attachment/58162/image-2022-06-09-16-27-10-256.png)
> 
Contributor guide
Research direction
Start in the workflow-cps-plugin component and reproduce the reported Pipeline case with a global variable and a local environment variable both named dc. Trace how the shell environment is assembled; done means the local lowercase dc value is available despite the existing global variable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100