public Issue createIssue(String projectKey, String description, String assignee, Iterable<String> components, String summary, @Nonnull Long issueTypeId, @Nullable Long priorityId) { final BasicIssue basicIssue = service.createIssue(projectKey, description, assignee, components, summary, issueTypeId, priorityId); return service.getIssue(basicIssue.getKey()); }
@Override public BasicIssue parse(JSONObject json) throws JSONException { final URI selfUri = JsonParseUtil.getSelfUri(json); final String key = json.getString("key"); final Long id = json.getLong("id"); return new BasicIssue(selfUri, key, id); } }
@Override public String toString() { return getToStringHelper().toString(); }
final URI selfUri = basicIssue.getSelf(); final Operations operations = parseOptionalJsonObject(issueJson, "operations", operationsJsonParser); return new Issue(summary, selfUri, basicIssue.getKey(), basicIssue.getId(), project, issueType, status, description, priority, resolution, attachments, reporter, assignee, creationDate, updateDate, dueDate, affectedVersions, fixVersions, components, timeTracking, fields, comments,
final URI selfUri = basicIssue.getSelf(); final Operations operations = parseOptionalJsonObject(issueJson, "operations", operationsJsonParser); return new Issue(summary, selfUri, basicIssue.getKey(), basicIssue.getId(), project, issueType, status, description, priority, resolution, attachments, reporter, assignee, creationDate, updateDate, dueDate, affectedVersions, fixVersions, components, timeTracking, fields, comments,
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());
@Override public String toString() { return getToStringHelper().toString(); }
@Override public BasicIssue parse(JSONObject json) throws JSONException { final URI selfUri = JsonParseUtil.getSelfUri(json); final String key = json.getString("key"); final Long id = json.getLong("id"); return new BasicIssue(selfUri, key, id); } }
ticket.setId(createdIssue.getKey());
@Override protected Objects.ToStringHelper getToStringHelper() { return super.getToStringHelper(). add("project", project). add("status", status).
ticket.setId(createdIssue.getKey());
@Override protected MoreObjects.ToStringHelper getToStringHelper() { return super.getToStringHelper(). add("project", project). add("status", status).