Interface IssueRestClient
public interface IssueRestClient
The com.atlassian.jira.rest.client.api handling issue resources.
- Since:
- 0.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumExpandos supported bygetIssue(String, Iterable) -
Method Summary
Modifier and TypeMethodDescriptionio.atlassian.util.concurrent.Promise<Void> addAttachment(URI attachmentsUri, InputStream in, String filename) Uploads attachments to JIRA (adding it to selected issue)io.atlassian.util.concurrent.Promise<Void> addAttachments(URI attachmentsUri, AttachmentInput... attachments) Uploads attachments to JIRA (adding it to selected issue)io.atlassian.util.concurrent.Promise<Void> addAttachments(URI attachmentsUri, File... files) Uploads attachments to JIRA (adding it to selected issue)io.atlassian.util.concurrent.Promise<Void> addComment(URI commentsUri, Comment comment) Adds a comment to JIRA (adding it to selected issue)io.atlassian.util.concurrent.Promise<Void> addWatcher(URI watchersUri, String username) Adds selected person as a watcher for selected issue.io.atlassian.util.concurrent.Promise<Void> addWorklog(URI worklogUri, WorklogInput worklogInput) Adds new worklog entry to issue.io.atlassian.util.concurrent.Promise<BasicIssue> createIssue(IssueInput issue) Creates new issue.io.atlassian.util.concurrent.Promise<BulkOperationResult<BasicIssue>> createIssues(Collection<IssueInput> issues) Creates new issues in batch.io.atlassian.util.concurrent.Promise<Void> deleteIssue(String issueKey, boolean deleteSubtasks) Deletes issue with given issueKey.io.atlassian.util.concurrent.Promise<InputStream> getAttachment(URI attachmentUri) Retrieves the content of given attachment.io.atlassian.util.concurrent.Promise<Iterable<CimProject>> Retrieves CreateIssueMetadata with specified filters.io.atlassian.util.concurrent.Promise<Page<CimFieldInfo>> getCreateIssueMetaFields(String projectIdOrKey, String issueTypeId, Long startAt, Integer maxResults) getCreateIssueMetaProjectIssueTypes(String projectIdOrKey, Long startAt, Integer maxResults) io.atlassian.util.concurrent.Promise<Issue> Retrieves issue with selected issue key.io.atlassian.util.concurrent.Promise<Issue> getIssue(String issueKey, Iterable<IssueRestClient.Expandos> expand) Retrieves issue with selected issue key, with specified additional expandos.io.atlassian.util.concurrent.Promise<Iterable<Transition>> getTransitions(Issue issue) Retrieves complete information (if the caller has permission) about transitions available for the selected issue in its current state.io.atlassian.util.concurrent.Promise<Iterable<Transition>> getTransitions(URI transitionsUri) Retrieves complete information (if the caller has permission) about transitions available for the selected issue in its current state.io.atlassian.util.concurrent.Promise<Votes> Retrieves complete information (if the caller has permission) about voters for selected issue.io.atlassian.util.concurrent.Promise<Watchers> getWatchers(URI watchersUri) Retrieves complete information (if the caller has permission) about watchers for selected issue.io.atlassian.util.concurrent.Promise<Void> linkIssue(LinkIssuesInput linkIssuesInput) Creates link between two issues and adds a comment (optional) to the source issues.io.atlassian.util.concurrent.Promise<Void> removeWatcher(URI watchersUri, String username) Removes selected person from the watchers list for selected issue.io.atlassian.util.concurrent.Promise<Void> transition(Issue issue, TransitionInput transitionInput) Performs selected transition on selected issue.io.atlassian.util.concurrent.Promise<Void> transition(URI transitionsUri, TransitionInput transitionInput) Performs selected transition on selected issue.io.atlassian.util.concurrent.Promise<Void> Removes your vote from the selected issue.io.atlassian.util.concurrent.Promise<Void> Stops watching selected issueio.atlassian.util.concurrent.Promise<Void> updateIssue(String issueKey, IssueInput issue) Update an existing issue.io.atlassian.util.concurrent.Promise<Void> Casts your vote on the selected issue.io.atlassian.util.concurrent.Promise<Void> Starts watching selected issue
-
Method Details
-
createIssue
Creates new issue.- Parameters:
issue- populated with data to create new issue- Returns:
- basicIssue with generated
issueKey - Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- Since:
- com.atlassian.jira.rest.client.api 1.0, server 5.0
-
updateIssue
Update an existing issue.- Parameters:
issueKey- issue key (like TST-1, or JRA-9)issue- populated with fields to set (no other verbs) in issue- Returns:
- Void
- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- Since:
- com.atlassian.jira.rest.client.api 3.0, server 5.0
-
getCreateIssueMetadata
io.atlassian.util.concurrent.Promise<Iterable<CimProject>> getCreateIssueMetadata(@Nullable GetCreateIssueMetadataOptions options) Retrieves CreateIssueMetadata with specified filters.- Parameters:
options- optional request configuration like filters and expandos. You may useGetCreateIssueMetadataOptionsBuilderto build them. Passnullif you don't want to set any option.- Returns:
- List of
CimProjectdescribing projects, issue types and fields. - Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- Since:
- com.atlassian.jira.rest.client.api 1.0, server 5.0
-
createIssues
io.atlassian.util.concurrent.Promise<BulkOperationResult<BasicIssue>> createIssues(Collection<IssueInput> issues) Creates new issues in batch.- Parameters:
issues- populated with data to create new issue- Returns:
- BulkOperationResult<BasicIssues> with generated
issueKeyand errors for failed issues - Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- Since:
- com.atlassian.jira.rest.client.api 2.0, server 6.0
-
getCreateIssueMetaProjectIssueTypes
-
getCreateIssueMetaFields
-
getIssue
Retrieves issue with selected issue key.- Parameters:
issueKey- issue key (like TST-1, or JRA-9)- Returns:
- issue with given
issueKey - Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
getIssue
io.atlassian.util.concurrent.Promise<Issue> getIssue(String issueKey, Iterable<IssueRestClient.Expandos> expand) Retrieves issue with selected issue key, with specified additional expandos.- Parameters:
issueKey- issue key (like TST-1, or JRA-9)expand- additional expands. Currently CHANGELOG is the only supported expand that is not expanded by default.- Returns:
- issue with given
issueKey - Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- Since:
- 0.6
-
deleteIssue
Deletes issue with given issueKey. You can setdeleteSubtasksto delete issue with subtasks. If issue have subtasks anddeleteSubtasksis set to false, then issue won't be deleted.- Parameters:
issueKey- issue key (like TST-1, or JRA-9)deleteSubtasks- Determines if subtask of issue should be also deleted. If false, and issue has subtasks, then it won't be deleted.- Returns:
- Void
- Since:
- 2.0
-
getWatchers
Retrieves complete information (if the caller has permission) about watchers for selected issue.- Parameters:
watchersUri- URI of watchers resource for selected issue. Usually obtained by callingIssue.getWatchers().getSelf()- Returns:
- detailed information about watchers watching selected issue.
- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- See Also:
-
getVotes
Retrieves complete information (if the caller has permission) about voters for selected issue.- Parameters:
votesUri- URI of voters resource for selected issue. Usually obtained by callingIssue.getVotesUri()- Returns:
- detailed information about voters of selected issue
- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- See Also:
-
getTransitions
Retrieves complete information (if the caller has permission) about transitions available for the selected issue in its current state.- Parameters:
transitionsUri- URI of transitions resource of selected issue. Usually obtained by callingIssue.getTransitionsUri()- Returns:
- transitions about transitions available for the selected issue in its current state.
- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
getTransitions
Retrieves complete information (if the caller has permission) about transitions available for the selected issue in its current state.- Parameters:
issue- issue- Returns:
- transitions about transitions available for the selected issue in its current state.
- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- Since:
- v0.5
-
transition
io.atlassian.util.concurrent.Promise<Void> transition(URI transitionsUri, TransitionInput transitionInput) Performs selected transition on selected issue.- Parameters:
transitionsUri- URI of transitions resource of selected issue. Usually obtained by callingIssue.getTransitionsUri()transitionInput- data for this transition (fields modified, the comment, etc.)- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
transition
Performs selected transition on selected issue.- Parameters:
issue- selected issuetransitionInput- data for this transition (fields modified, the comment, etc.)- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)- Since:
- v0.5
-
vote
Casts your vote on the selected issue. Casting a vote on already votes issue by the caller, causes the exception.- Parameters:
votesUri- URI of votes resource for selected issue. Usually obtained by callingIssue.getVotesUri()- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
unvote
Removes your vote from the selected issue. Removing a vote from the issue without your vote causes the exception.- Parameters:
votesUri- URI of votes resource for selected issue. Usually obtained by callingIssue.getVotesUri()- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
watch
Starts watching selected issue- Parameters:
watchersUri- URI of watchers resource for selected issue. Usually obtained by callingIssue.getWatchers().getSelf()- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
unwatch
Stops watching selected issue- Parameters:
watchersUri- URI of watchers resource for selected issue. Usually obtained by callingIssue.getWatchers().getSelf()- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
addWatcher
Adds selected person as a watcher for selected issue. You need to have permissions to do that (otherwise the exception is thrown).- Parameters:
watchersUri- URI of watchers resource for selected issue. Usually obtained by callingIssue.getWatchers().getSelf()username- user to add as a watcher- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
removeWatcher
Removes selected person from the watchers list for selected issue. You need to have permissions to do that (otherwise the exception is thrown).- Parameters:
watchersUri- URI of watchers resource for selected issue. Usually obtained by callingIssue.getWatchers().getSelf()username- user to remove from the watcher list- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, etc.)
-
linkIssue
Creates link between two issues and adds a comment (optional) to the source issues.- Parameters:
linkIssuesInput- details for the link and the comment (optional) to be created- Throws:
RestClientException- in case of problems (connectivity, malformed messages, invalid argument, permissions, etc.)- Since:
- com.atlassian.jira.rest.client.api 0.2, server 4.3
-
addAttachment
io.atlassian.util.concurrent.Promise<Void> addAttachment(URI attachmentsUri, InputStream in, String filename) Uploads attachments to JIRA (adding it to selected issue)- Parameters:
attachmentsUri- where to upload the attachment. You can get this URI by examining issue resource firstin- stream from which to read data to uploadfilename- file name to use for the uploaded attachment- Since:
- com.atlassian.jira.rest.client.api 0.2, server 4.3
-
addAttachments
io.atlassian.util.concurrent.Promise<Void> addAttachments(URI attachmentsUri, AttachmentInput... attachments) Uploads attachments to JIRA (adding it to selected issue)- Parameters:
attachmentsUri- where to upload the attachments. You can get this URI by examining issue resource firstattachments- attachments to upload- Since:
- com.atlassian.jira.rest.client.api 0.2, server 4.3
-
addAttachments
Uploads attachments to JIRA (adding it to selected issue)- Parameters:
attachmentsUri- where to upload the attachments. You can get this URI by examining issue resource firstfiles- files to upload- Since:
- com.atlassian.jira.rest.client.api 0.2, server 4.3
-
addComment
Adds a comment to JIRA (adding it to selected issue)- Parameters:
commentsUri- where to add commentcomment- theCommentto add- Since:
- com.atlassian.jira.rest.client.api 1.0, server 5.0
-
getAttachment
Retrieves the content of given attachment.- Parameters:
attachmentUri- URI for the attachment to retrieve- Returns:
- stream from which the caller may read the attachment content (bytes). The caller is responsible for closing the stream.
-
addWorklog
Adds new worklog entry to issue.- Parameters:
worklogUri- URI for worklog in issueworklogInput- worklog input object to create
-