com.atlassian.jira.rest.client
Interface IssueRestClient


public interface IssueRestClient

The client handling issue resources.

Since:
0.1

Nested Class Summary
static class IssueRestClient.Expandos
          Expandos supported by getIssue(String, Iterable, ProgressMonitor)
 
Method Summary
 void addAttachment(ProgressMonitor progressMonitor, URI attachmentsUri, InputStream in, String filename)
          Uploads attachments to JIRA (adding it to selected issue)
 void addAttachments(ProgressMonitor progressMonitor, URI attachmentsUri, AttachmentInput... attachments)
          Uploads attachments to JIRA (adding it to selected issue)
 void addAttachments(ProgressMonitor progressMonitor, URI attachmentsUri, File... files)
          Uploads attachments to JIRA (adding it to selected issue)
 void addComment(ProgressMonitor progressMonitor, URI commentsUri, Comment comment)
          Adds a comment to JIRA (adding it to selected issue)
 void addWatcher(URI watchersUri, String username, ProgressMonitor progressMonitor)
          Adds selected person as a watcher for selected issue.
 void addWorklog(URI worklogUri, WorklogInput worklogInput, ProgressMonitor progressMonitor)
          Adds new worklog entry to issue.
 BasicIssue createIssue(IssueInput issue, ProgressMonitor progressMonitor)
          Creates new issue.
 InputStream getAttachment(ProgressMonitor pm, URI attachmentUri)
          Retrieves the content of given attachment.
 Iterable<CimProject> getCreateIssueMetadata(GetCreateIssueMetadataOptions options, ProgressMonitor progressMonitor)
          Retrieves CreateIssueMetadata with specified filters.
 Issue getIssue(String issueKey, Iterable<IssueRestClient.Expandos> expand, ProgressMonitor progressMonitor)
          Retrieves issue with selected issue key, with specified additional expandos.
 Issue getIssue(String issueKey, ProgressMonitor progressMonitor)
          Retrieves issue with selected issue key.
 Iterable<Transition> getTransitions(Issue issue, ProgressMonitor progressMonitor)
          Retrieves complete information (if the caller has permission) about transitions available for the selected issue in its current state.
 Iterable<Transition> getTransitions(URI transitionsUri, ProgressMonitor progressMonitor)
          Retrieves complete information (if the caller has permission) about transitions available for the selected issue in its current state.
 Votes getVotes(URI votesUri, ProgressMonitor progressMonitor)
          Retrieves complete information (if the caller has permission) about voters for selected issue.
 Watchers getWatchers(URI watchersUri, ProgressMonitor progressMonitor)
          Retrieves complete information (if the caller has permission) about watchers for selected issue.
 void linkIssue(LinkIssuesInput linkIssuesInput, ProgressMonitor progressMonitor)
          Creates link between two issues and adds a comment (optional) to the source issues.
 void removeWatcher(URI watchersUri, String username, ProgressMonitor progressMonitor)
          Removes selected person from the watchers list for selected issue.
 void transition(Issue issue, TransitionInput transitionInput, ProgressMonitor progressMonitor)
          Performs selected transition on selected issue.
 void transition(URI transitionsUri, TransitionInput transitionInput, ProgressMonitor progressMonitor)
          Performs selected transition on selected issue.
 void unvote(URI votesUri, ProgressMonitor progressMonitor)
          Removes your vote from the selected issue.
 void unwatch(URI watchersUri, ProgressMonitor progressMonitor)
          Stops watching selected issue
 void vote(URI votesUri, ProgressMonitor progressMonitor)
          Casts your vote on the selected issue.
 void watch(URI watchersUri, ProgressMonitor progressMonitor)
          Starts watching selected issue
 

Method Detail

createIssue

BasicIssue createIssue(IssueInput issue,
                       ProgressMonitor progressMonitor)
Creates new issue.

Parameters:
issue - populated with data to create new issue
progressMonitor - progress monitor
Returns:
basicIssue with generated issueKey
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)
Since:
client 1.0, server 5.0

getCreateIssueMetadata

Iterable<CimProject> getCreateIssueMetadata(@Nullable
                                            GetCreateIssueMetadataOptions options,
                                            ProgressMonitor progressMonitor)
Retrieves CreateIssueMetadata with specified filters.

Parameters:
options - optional request configuration like filters and expandos. You may use GetCreateIssueMetadataOptionsBuilder to build them. Pass null if you don't want to set any option.
progressMonitor - progress monitor
Returns:
List of CimProject describing projects, issue types and fields.
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)
Since:
client 1.0, server 5.0

getIssue

Issue getIssue(String issueKey,
               ProgressMonitor progressMonitor)
Retrieves issue with selected issue key.

Parameters:
issueKey - issue key (like TST-1, or JRA-9)
progressMonitor - progress monitor
Returns:
issue with given issueKey
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

getIssue

Issue getIssue(String issueKey,
               Iterable<IssueRestClient.Expandos> expand,
               ProgressMonitor progressMonitor)
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.
progressMonitor - progress monitor
Returns:
issue with given issueKey
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)
Since:
0.6

getWatchers

Watchers getWatchers(URI watchersUri,
                     ProgressMonitor progressMonitor)
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 calling Issue.getWatchers().getSelf()
progressMonitor - progress monitor
Returns:
detailed information about watchers watching selected issue.
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)
See Also:
Issue.getWatchers()

getVotes

Votes getVotes(URI votesUri,
               ProgressMonitor progressMonitor)
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 calling Issue.getVotesUri()
progressMonitor - progress monitor
Returns:
detailed information about voters of selected issue
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)
See Also:
Issue.getVotesUri()

getTransitions

Iterable<Transition> getTransitions(URI transitionsUri,
                                    ProgressMonitor progressMonitor)
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 calling Issue.getTransitionsUri()
progressMonitor - progress monitor
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

Iterable<Transition> getTransitions(Issue issue,
                                    ProgressMonitor progressMonitor)
Retrieves complete information (if the caller has permission) about transitions available for the selected issue in its current state.

Parameters:
issue - issue
progressMonitor - progress monitor
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

void transition(URI transitionsUri,
                TransitionInput transitionInput,
                ProgressMonitor progressMonitor)
Performs selected transition on selected issue.

Parameters:
transitionsUri - URI of transitions resource of selected issue. Usually obtained by calling Issue.getTransitionsUri()
transitionInput - data for this transition (fields modified, the comment, etc.)
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

transition

void transition(Issue issue,
                TransitionInput transitionInput,
                ProgressMonitor progressMonitor)
Performs selected transition on selected issue.

Parameters:
issue - selected issue
transitionInput - data for this transition (fields modified, the comment, etc.)
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)
Since:
v0.5

vote

void vote(URI votesUri,
          ProgressMonitor progressMonitor)
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 calling Issue.getVotesUri()
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

unvote

void unvote(URI votesUri,
            ProgressMonitor progressMonitor)
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 calling Issue.getVotesUri()
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

watch

void watch(URI watchersUri,
           ProgressMonitor progressMonitor)
Starts watching selected issue

Parameters:
watchersUri - URI of watchers resource for selected issue. Usually obtained by calling Issue.getWatchers().getSelf()
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

unwatch

void unwatch(URI watchersUri,
             ProgressMonitor progressMonitor)
Stops watching selected issue

Parameters:
watchersUri - URI of watchers resource for selected issue. Usually obtained by calling Issue.getWatchers().getSelf()
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

addWatcher

void addWatcher(URI watchersUri,
                String username,
                ProgressMonitor progressMonitor)
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 calling Issue.getWatchers().getSelf()
username - user to add as a watcher
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

removeWatcher

void removeWatcher(URI watchersUri,
                   String username,
                   ProgressMonitor progressMonitor)
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 calling Issue.getWatchers().getSelf()
username - user to remove from the watcher list
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, etc.)

linkIssue

void linkIssue(LinkIssuesInput linkIssuesInput,
               ProgressMonitor progressMonitor)
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
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, invalid argument, permissions, etc.)
Since:
client 0.2, server 4.3

addAttachment

void addAttachment(ProgressMonitor progressMonitor,
                   URI attachmentsUri,
                   InputStream in,
                   String filename)
Uploads attachments to JIRA (adding it to selected issue)

Parameters:
progressMonitor - progress monitor
attachmentsUri - where to upload the attachment. You can get this URI by examining issue resource first
in - stream from which to read data to upload
filename - file name to use for the uploaded attachment
Since:
client 0.2, server 4.3

addAttachments

void addAttachments(ProgressMonitor progressMonitor,
                    URI attachmentsUri,
                    AttachmentInput... attachments)
Uploads attachments to JIRA (adding it to selected issue)

Parameters:
progressMonitor - progress monitor
attachmentsUri - where to upload the attachments. You can get this URI by examining issue resource first
attachments - attachments to upload
Since:
client 0.2, server 4.3

addAttachments

void addAttachments(ProgressMonitor progressMonitor,
                    URI attachmentsUri,
                    File... files)
Uploads attachments to JIRA (adding it to selected issue)

Parameters:
progressMonitor - progress monitor
attachmentsUri - where to upload the attachments. You can get this URI by examining issue resource first
files - files to upload
Since:
client 0.2, server 4.3

addComment

void addComment(ProgressMonitor progressMonitor,
                URI commentsUri,
                Comment comment)
Adds a comment to JIRA (adding it to selected issue)

Parameters:
progressMonitor - the ProgressMonitor
commentsUri - where to add comment
comment - the Comment to add
Since:
client 1.0, server 5.0

getAttachment

@Beta
InputStream getAttachment(ProgressMonitor pm,
                               URI attachmentUri)
Retrieves the content of given attachment.

Parameters:
pm - progress monitor
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

void addWorklog(URI worklogUri,
                WorklogInput worklogInput,
                ProgressMonitor progressMonitor)
Adds new worklog entry to issue.

Parameters:
progressMonitor - progress monitor
worklogUri - URI for worklog in issue
worklogInput - worklog input object to create


Copyright © 2012 Atlassian Pty Ltd. All Rights Reserved.