Issue
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?
Solution
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.
Answered By - gareth_bowles
Answer Checked By - Timothy Miller (JavaFixing Admin)