gitlab4j-api
gitlab4j-api copied to clipboard
JobApi doesn't allow to specify several JobScope
trafficstars
We cannot provide several JobScope for this method whereas Gitlab API allows it:
see org.gitlab4j.api.JobApi#getJobs(java.lang.Object, org.gitlab4j.api.Constants.JobScope)
Workaround is for instance:
GitLabApiForm formData = new GitLabApiForm().withParam("scope", Arrays.asList(Constants.JobScope.SUCCESS, Constants.JobScope.RUNNING, Constants.JobScope.PENDING));
JobApi jobApi = gitLabApi.getJobApi();
Pager<Job> jobPager = new Pager<>(jobApi, Job.class, gitLabApi.getDefaultPerPage(), formData.asMap(),
"projects", jobApi.getProjectIdOrPath(PROJECT_ID), "jobs");
Note: I can provide a PR if you want ;-)
If I read the doc correctly it says:
string or array of strings
https://docs.gitlab.com/ee/api/jobs.html
So yes if you create a PR, I will be happy to integrate it