Home > Back-end >  How to compare jenkins BUILD_USER of replay and the original job?
How to compare jenkins BUILD_USER of replay and the original job?

Time:01-16

Is there a way Jenkins knows how to compare between user (user b) who did replay job to the user who ran the original job (user a)?

CodePudding user response:

I couldn't find the answer, but during my searches I reached to this helpful thread: How to know inside jenkinsfile / script that current build is a replay?

CodePudding user response:

You can use the Audit Trail plugin to see the user who did the replay and original job or use the Jenkins REST API to get build information and compare BUILD_USER variable of the replay and original build, the API looks like this: <Jenkins_URL>/job/<Job_Name>/<Build_Number>/api/json

  • Related