com.atlassian.jira.rest.client
Interface IssueRestClient


public interface IssueRestClient

The client handling issue resources.

Since:
v0.1

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 addWatcher(URI watchersUri, String username, ProgressMonitor progressMonitor)
          Adds selected person as a watcher for selected issue.
 InputStream getAttachment(ProgressMonitor pm, URI attachmentUri)
          Retrieves the content of given attachment.
 Issue getIssue(String issueKey, ProgressMonitor progressMonitor)
          Retrieves issue with selected issue key.
 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(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

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.)

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.)

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.)

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 -
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 -
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 -
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 -
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

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.


Copyright © 2011 Atlassian Pty Ltd. All Rights Reserved.