I would like to write a script to automate the feature branch creation for hot-fixes. In order to do that I need to figure out how to see what was the last commit in the cur
You did not specify which API would you prefer to use. But assuming Jenkins XML API it would be something like:
http://myjenkins/job/myJobName/lastBuild/api/xml?xpath=//lastBuiltRevision/SHA1