I can go to
http://myjenkins:8080/job/Project/42/changes
and see the commit message that triggered a particular Jenkins build.
However, I want to grab this via REST API or something. I'm not having any luck in search. Is there an easy way to do this?
Here's an example of how to get the comment, affected files and commit ID from a Jenkins build:
curl http://jenkins/job/JOB_NAME/BUILD_NUMBER/api/json?pretty=true&tree=changeSet[items[comment,affectedPaths,commitId]]
Here's an explanation of how the tree and depth parameters work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With