Yellesh Chaparthi
Yellesh Chaparthi

Reputation: 413

How to get the Jenkins created data and time

I am trying to get the Jenkins build creation date and time.

I tried to get the information using Jenkins rest Api, even rest API is also not saving any information on the Jenkins job creation.

I tried for plugins to get the information but I did,t get proper plugin to save this information.

Please help me on this issue, thanks in advance.

Yellesh.

Upvotes: 1

Views: 4862

Answers (2)

Dave Horner
Dave Horner

Reputation: 423

The date of creation is pretty straight forward to get using the jobConfigHistory plugin and the /jobConfigHistory/api/json endpoint.

Choose the earliest json object (the earliest two are usually noted as "operation": "Changed" for some reason) or choose the json object that has "operation": "Created".

I think that a plugin shouldn't be needed to ascertain the date of creation for a Job, but this method does seem to work. I've created a Jenkins Improvement Ticket 28164 requesting the core provide this detail.

Upvotes: 1

Praba
Praba

Reputation: 1381

I hope you stumbled upon this: https://wiki.jenkins-ci.org/display/JENKINS/Timestamper - their doc says "Scripts can read the timestamps from the /timestamps URL of each build". This doesn't help you?

Upvotes: 0

Related Questions