Merge pull request #48 from kasper-f/mergeRequestFromTargetRepo

Fixed #47 by changing to use the target repo id instead of the source id
This commit is contained in:
bassrock 2015-01-27 11:05:47 -08:00
commit cf0ae24a02
1 changed files with 2 additions and 1 deletions

View File

@ -245,7 +245,8 @@ public class GitLabPushTrigger extends Trigger<AbstractProject<?, ?>> {
msg.append("\n\nResults available at: ")
.append("[").append("Jenkins").append("](").append(buildUrl).append(")");
try {
GitlabProject proj = cause.getMergeRequest().getSourceProject(this.getDescriptor().getGitlab());
GitlabProject proj = new GitlabProject();
proj.setId(cause.getMergeRequest().getObjectAttribute().getTargetProjectId());
org.gitlab.api.models.GitlabMergeRequest mr = this.getDescriptor().getGitlab().instance().getMergeRequest(proj,cause.getMergeRequest().getObjectAttribute().getId());
this.getDescriptor().getGitlab().instance().createNote(mr,msg.toString());
} catch (IOException e) {