The Jenkins changeset
function didn't seem to work predicably enough,
as described in How to access Changelogs in a Pipeline Job?
So instead I wrote this quick invoke script to pull the changes directly from the git logs.
This assumes changes are done in PRs, so when on run on master the task will look for all changes
2 PRs back, but when developing off master it will look for the first PR it finds.
This of course will have issues, if you've merged a PR into another branch and then merged the branch, but for my use case this should be fine.