I put all my Jenkins logic in a structured script pipeline (also known as Jenkinsfile).
If something goes wrong, I send letters. For the subject, I want to use displayNametasks, not task identifiers env.JOB_NAME(since they are controlled by access control and non-readability patterns).
With a normal pipelined job, I could use currentBuild.rawBuild.project.displayName, but for multi-channel pipelines, it's just the name of a branch.
Or is there an even better way to get the username and then switch to rawBuild?
source
share