jenkins-rest
jenkins-rest copied to clipboard
ChangeSet not have value
jenkins version: Jenkins 2.357
I use java code, not have changeSet information
JenkinsClient client = JenkinsClient.builder()
.endPoint("http://127.0.0.1:8080") // Optional. Defaults to http://127.0.0.1:8080
.credentials("admin:admin") // Optional.
.build();
JobsApi jobsApi = client.api().jobsApi();
BuildInfo buildInfo = jobsApi.buildInfo(null, "test", 36);
System.out.println(buildInfo);
// buildInfo.changeSets is 0
I use rest api , have changeSet information
curl http://127.0.0.1:8080/job/test/36/api/json
result: { ....... "changeSet": { "_class": "hudson.scm.SubversionChangeLogSet", "items": [ { "_class": "hudson.scm.SubversionChangeLogSet$LogEntry", "affectedPaths": [ "test/src/main/resources/application-dev.yml" ], "author": { "absoluteUrl": "http://127.0.0.1:8080/user/admin", "fullName": "admin" }, "commitId": "450", "timestamp": 1655719517084, "date": "2022-06-20T10:05:17.084449Z", "msg": "+ 调整redis database", "paths": [....], ....... },
@ChenAdminChen have a look at THIS CODE and see if that works out for you.
I
@ChenAdminChen have a look at THIS CODE and see if that works out for you.
I found out the cause of the problem, the http://127.0.0.1:8080/job/test/36/api/json API return changeSet but not changeSets, and the changeSet is Object but not List Conllection
I pull code and adjust the code, is ok

I use jenkins version is 2.357, I don't know if it's a version problem???
i have the same problem , and i found it call "changeSet" in FreeStyleProject and call "changeSets" in WorkflowJob. maybe it should be become the same
If someone would like to send in a PR for this quickfix I'd be more than happy to merge it and kick a new release.