@SuppressWarnings("unused") public IssueInputBuilder(BasicProject project, IssueType issueType, String summary) { this(project, issueType); setSummary(summary); }
@SuppressWarnings("unused") public IssueInputBuilder(String projectKey, Long issueTypeId, String summary) { this(projectKey, issueTypeId); setSummary(summary); }
@SuppressWarnings("unused") public IssueInputBuilder(BasicProject project, IssueType issueType, String summary) { this(project, issueType); setSummary(summary); }
@SuppressWarnings("unused") public IssueInputBuilder(String projectKey, Long issueTypeId, String summary) { this(projectKey, issueTypeId); setSummary(summary); }
IssueInputBuilder issueBuilder = new IssueInputBuilder("Project1", 5L);//5 is the id for subtask type. You can know the id of subtask type by querying this REST api /rest/api/2/issue/createmeta issueBuilder.setDescription(">> Test Description"); issueBuilder.setSummary("Test summary"); issueBuilder.setProjectKey("Project1"); Map<String, Object> parent = new HashMap<String, Object>(); parent.put("key", "SOMEISSUE-234"); FieldInput parentField = new FieldInput("parent", new ComplexIssueInputFieldValue(parent)); Map<String, Object> customField = new HashMap<String, Object>(); customField.put("value", "someValue");//This is some custom field value on the subtask customField.put("id", "12345");//This is the id of the custom field. You can know this by calling REST GET for a manually created sub-task issueBuilder.setFieldInput(parentField); issueBuilder.setFieldValue("customfield_12345", new ComplexIssueInputFieldValue(customField));//here again you have to query an existing subtask to know the "customfield_*" value com.atlassian.jira.rest.client.domain.input.IssueInput issueInput = issueBuilder.build(); BasicIssue bIssue = restClient.getIssueClient().createIssue(issueInput, pm); System.out.println(">>> " + bIssue.getKey());
public BasicIssue createIssue(String projectKey, String description, String assignee, Iterable<String> components, String summary, @Nonnull Long issueTypeId, @Nullable Long priorityId) { IssueInputBuilder builder = new IssueInputBuilder(); builder.setProjectKey(projectKey) .setDescription(description) .setIssueTypeId(issueTypeId) .setSummary(summary); if (priorityId != null) { builder.setPriorityId(priorityId); } if (!assignee.equals("")) builder.setAssigneeName(assignee); if (Iterators.size(components.iterator()) > 0){ builder.setComponentsNames(components); } final IssueInput issueInput = builder.build(); try { return jiraRestClient.getIssueClient().createIssue(issueInput).get(timeout, TimeUnit.SECONDS); } catch (Exception e) { LOGGER.log(WARNING, "JIRA REST createIssue error: " + e.getMessage(), e); return null; } }
config.getIssueTypeId()); builder.setReporterName(config.getUsername()); builder.setSummary(ticket.getSummary()); builder.setDescription(ticket.getDetails());
config.getIssueTypeId()); builder.setReporterName(config.getUsername()); builder.setSummary(ticket.getSummary()); builder.setDescription(ticket.getDetails());