0

I have two test jobs(say job A and job B), and will run the test report job(say job C) after job A and job B finished, and will send test report with the email template which I want to contain job A and job B duration string. So how to get the job A and job B duration string in job C?

yyzhang14922
  • 59
  • 1
  • 2
  • 9

1 Answers1

0

You can curl the api for the json for the build to get the duration and convert it to human readable format:

https://<jenkins-url>:<port>/job/<job-name>/lastBuild/api/json

If you want to see a 'pretty' version of the json, you can append the below to the above url:

?pretty=true

There will be a duration variable within the json that will contain the time spent building (not sure if it highlights any 'waiting' time).

Some examples of people doing similar things:

hhami
  • 176
  • 10