package org.kohsuke.github;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Kohsuke Kawaguchi
 */
public class GHIssueBuilder {
    private final GHRepository repo;
    private final Requester builder;
    private List<String> labels = new ArrayList<String>();

    GHIssueBuilder(GHRepository repo, String title) {
        this.repo = repo;
        this.builder = new Requester(repo.root);
        builder.with("title",title);
    }

    /**
     * Sets the main text of an issue, which is arbitrary multi-line text.
     */
    public GHIssueBuilder body(String str) {
        builder.with("body",str);
        return this;
    }

    public GHIssueBuilder assignee(GHUser user) {
        if (user!=null)
            builder.with("assignee",user.getLogin());
        return this;
    }

    public GHIssueBuilder assignee(String user) {
        if (user!=null)
            builder.with("assignee",user);
        return this;
    }

    public GHIssueBuilder milestone(GHMilestone milestone) {
        if (milestone!=null)
            builder.with("milestone",milestone.getNumber());
        return this;
    }

    public GHIssueBuilder label(String label) {
        if (label!=null)
            labels.add(label);
        return this;
    }

    /**
     * Creates a new issue.
     */
    public GHIssue create() throws IOException {
        return builder.with("labels",labels).to(repo.getApiTailUrl("issues"),GHIssue.class).wrap(repo);
    }
}

@@ -301,16 +301,78 @@
 ring%3E();
+%0A    private List%3CString%3E assignees = new ArrayList%3CString%3E();
 %0A%0A    GH
@@ -822,38 +822,24 @@
         
-builder.with(%22
 assignee
 %22,user.g
@@ -826,26 +826,30 @@
     assignee
-%22,
+s.add(
 user.getLogi
@@ -972,30 +972,16 @@
     
-builder.with(%22
 assignee
 %22,us
@@ -976,18 +976,22 @@
 assignee
-%22,
+s.add(
 user);%0A 
@@ -1421,16 +1421,16 @@
 ption %7B%0A
-
         
@@ -1466,16 +1466,44 @@
 labels).
+with(%22assignees%22,assignees).
 to(repo.

Support assignees when creating a new issue