Gitlab4j API: PipelineApi

I want initiate build/test from java program.,( not necessarily on code commit to current project, but based on 3rd party binary updates which are managed externally)

I am trying Pipeline b = pipeapi.createPipeline(1, “master”);
but it is failing with following error
at org.gitlab4j.api.AbstractApi.validate(AbstractApi.java:322)
at org.gitlab4j.api.AbstractApi.post(AbstractApi.java:156)
at org.gitlab4j.api.PipelineApi.createPipeline(PipelineApi.java:196)
at com.esi.vdss.th.service.THService.main(THService.java:121)

Even passing commit ID as second argument did not help.

I can pre-create pipeline and re-run it, even this seems to be not possible.

pipeapi.retryPipelineJob(1, 8);

org.gitlab4j.api.GitLabApiException: Created
…done
at org.gitlab4j.api.AbstractApi.validate(AbstractApi.java:322)
at org.gitlab4j.api.AbstractApi.post(AbstractApi.java:120)
at org.gitlab4j.api.PipelineApi.retryPipelineJob(PipelineApi.java:212)
at com.esi.vdss.th.service.THService.main(THService.java:120)

please suggest what is wrong, also is there any other elegant approach to this ?

All,
I found the issue, i think gitlab4j has wrong implementation for pipe creation API
i extended piecreation APIs and reimplemented as follows, this works,
This seems to be bug and needs fix from gitlab4j .

public Pipeline createPipeline(int projectid, String reference) {
	
	
	MultivaluedHashMap<String, String> map = new MultivaluedHashMap<>();
	map.add("ref", reference);

    Response response=null;
	try {
		
		response = post(**Response.Status.CREATED**, map, "projects", projectid, **"pipeline"**);
		return (response.readEntity(Pipeline.class));
		 
	} catch (GitLabApiException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
}

@anand.rayudu
I am the author of GitLab4J, and just noticed this post. I have also made the fix in GitLab4J (status should have been CREATED vs. OK). In the future if problems related to GitLab4J could be posted at: https://github.com/gmessner/gitlab4j-api/issues it will help improve the project.

Thanks,
Greg

Greg, Thanks a lot, for the fix and suggestion, I shall follow your suggestion.

Best Regards
Anand