Search code examples
jenkinsjenkins-pluginsjenkins-pipelinecloudbees

Jenkins build trigger


I used jenkins remote trigger build option at job A and triggered another job B. When I open job B build, I could see "Started by remote project <path to job A>". I am trying to get the value from job B after execution but I not working. I tried working with BuildUser plugin which gave null output. Could someone help me to find a way to find the information?


Solution

  • The Parameterized Remote Trigger Plugin job setup options have a section Build Info with a field Parameters. Define parameters there like:

    TRIGGERED_BY_JOB=${JOB_NAME}
    TRIGGERED_BY_BUILD_NO=${BUILD_NUMBER}
    

    and use them accordingly in your job B.

    See Jenkins Set Environment Variables for other available information.