I'm late to the party on this one, but this question got me into #jenkins chat where I spent most of my day today. I would like to thank @tang ^ from this chat for helping to solve this gracefully for my situation.
To set the JOB description and JOB display name for the child in the DECLARATIVE pipeline, use the following step in the step:
steps { script { if(currentBuild.rawBuild.project.displayName != 'jobName') { currentBuild.rawBuild.project.description = 'NEW JOB DESCRIPTION' currentBuild.rawBuild.project.setDisplayName('NEW JOB DISPLAY NAME') } else { echo 'Name change not required' } } }
This will require that you approve individual script calls through the Sandbox Sanden approval method, but it was much simpler than anything I found on the Internet about renaming the actual children of the parent pipeline. The last thing to note is that this should work in a Jenkins file, where you can use environment variables to manage installed tasks.
3lektrix
source share