public interface

RemoteJiraRestService

com.atlassian.jira.plugin.link.remotejira.RemoteJiraRestService
Known Indirect Subclasses

Class Overview

Helper class for making REST calls to JIRA servers.

Summary

Nested Classes
enum RemoteJiraRestService.RestVersion  
Public Methods
RemoteResponse<JSONObject> createRemoteIssueLink(ApplicationLink applicationLink, String remoteIssueKey, Issue issue, String relationship, RemoteJiraRestService.RestVersion restVersion)
Creates a remote issue link between the given remote issue and the given local issue.
RemoteResponse<RemoteJiraIssue> getIssue(String baseUri, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion)
Gets the issue with the given key, on the JIRA server given by the application link.
RemoteResponse<RemoteJiraIssue> getIssue(ApplicationLink applicationLink, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion)
Gets the issue with the given key, on the JIRA server given by the application link.
RemoteResponse<String> requestResource(ApplicationLink applicationLink, String resourcePath, Map<StringString> params, RemoteJiraRestService.RestVersion restVersion)
Request the given REST resource on the given JIRA server with the given params.
RemoteResponse<String> requestURL(ApplicationLink applicationLink, String url, Map<StringString> params)
Request the given URL on the given JIRA server with the given params.

Public Methods

public RemoteResponse<JSONObject> createRemoteIssueLink (ApplicationLink applicationLink, String remoteIssueKey, Issue issue, String relationship, RemoteJiraRestService.RestVersion restVersion)

Creates a remote issue link between the given remote issue and the given local issue.

Parameters
applicationLink the application link of the remote JIRA server
remoteIssueKey the issue key of the remote issue
issue the local issue
relationship the relationship for the link
restVersion the version of the REST API to invoke
Returns
Throws
CredentialsRequiredException thrown if authentication is required
ResponseException thrown if the response cannot be retrieved

public RemoteResponse<RemoteJiraIssue> getIssue (String baseUri, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion)

Gets the issue with the given key, on the JIRA server given by the application link.

Parameters
baseUri the base URI of the JIRA instance
issueIdOrKey the issue ID or key
restVersion the version of the REST API to invoke
Returns
Throws
CredentialsRequiredException thrown if authentication is required
ResponseException thrown if the response cannot be retrieved

public RemoteResponse<RemoteJiraIssue> getIssue (ApplicationLink applicationLink, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion)

Gets the issue with the given key, on the JIRA server given by the application link.

Parameters
applicationLink the application link of the JIRA server
issueIdOrKey the issue ID or key
restVersion the version of the REST API to invoke
Returns
Throws
CredentialsRequiredException thrown if authentication is required
ResponseException thrown if the response cannot be retrieved

public RemoteResponse<String> requestResource (ApplicationLink applicationLink, String resourcePath, Map<StringString> params, RemoteJiraRestService.RestVersion restVersion)

Request the given REST resource on the given JIRA server with the given params.

Parameters
applicationLink the application link of the JIRA server
resourcePath the path of the REST resource, e.g. issue
params the parameters to add to the request
restVersion the version of the REST API to invoke
Returns
Throws
CredentialsRequiredException thrown if authentication is required
ResponseException thrown if the response cannot be retrieved

public RemoteResponse<String> requestURL (ApplicationLink applicationLink, String url, Map<StringString> params)

Request the given URL on the given JIRA server with the given params. The URL does not need to be a REST resource.

Parameters
applicationLink the application link of the JIRA server
url the relative URL to request, from the base URL of the applicationLink, e.g. secure/Dashboard.jspa
params the parameters to add to the request
Returns
Throws
CredentialsRequiredException thrown if authentication is required
ResponseException thrown if the response cannot be retrieved