The tl;dr:
I have a Jenkins job (Job #1). I want to call a second job using the Promoted Build Plugin (Job #2). Job #2 is parameterized and needs an artifactory URL generated by Job #1 - how can I pass a parameter from Job #1 to Job #2? Using an Approval Parameter doesn't seem to work, since this parameter is composed of environment variables. I literally just want to create an environment variable in Job #1 and then pass it as a param to Job #2 - surely there is a way to do this?
Use Case:
I have a Jenkins job that uploads an artifact to artifactory. I am trying to use the Promoted Build Plugin to trigger a second job that takes the artifactory URL as a parameter. However, I can't seem to find any way to pass it the artifactory URL - in the job itself, I create the URL from $DEPLOY_URL/$DEPLOY_URL-$BUILD_ID.tar.gz - but, when the promotion script runs, $BUILD_ID has a different value, since the promotion technically takes place inside a different job (as far as I can tell, the way the plugin works is it creates a little mini-job that handles build promotions, and they have their own numbering). I tried just saving the full URL into a variable called $ARTIFACTORY_URL in a shell script, but again, the promotion job doesn't seem to have access to it. How can I pass a variable from my Jenkins job to the promotion job?