Class RemoteJiraRestServiceImpl
java.lang.Object
com.atlassian.jira.plugin.link.remotejira.RemoteJiraRestServiceImpl
- All Implemented Interfaces:
RemoteJiraRestService
Helper class for making REST calls to JIRA servers.
Supported REST API versions are:
- 2.0alpha1
- 2
- Since:
- v5.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.plugin.link.remotejira.RemoteJiraRestService
RemoteJiraRestService.RestVersion -
Constructor Summary
ConstructorsConstructorDescriptionRemoteJiraRestServiceImpl(com.atlassian.applinks.host.spi.InternalHostApplication internalHostApplication, com.atlassian.sal.api.net.RequestFactory<com.atlassian.sal.api.net.Request<?, com.atlassian.sal.api.net.Response>> requestFactory) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildIssueUrl(String baseUri, String issueKey) createRemoteIssueLink(com.atlassian.applinks.api.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.getIssue(com.atlassian.applinks.api.ApplicationLink applicationLink, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion) Gets the issue with the given key, on the JIRA server given by the application link.getIssue(String baseUri, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion) Gets the issue with the given key, on the JIRA server given by the application link.requestResource(com.atlassian.applinks.api.ApplicationLink applicationLink, String resourcePath, Map<String, String> params, RemoteJiraRestService.RestVersion restVersion) Request the given REST resource on the given JIRA server with the given params.requestURL(com.atlassian.applinks.api.ApplicationLink applicationLink, String url, Map<String, String> params) Request the given URL on the given JIRA server with the given params.
-
Constructor Details
-
RemoteJiraRestServiceImpl
@Autowired public RemoteJiraRestServiceImpl(com.atlassian.applinks.host.spi.InternalHostApplication internalHostApplication, com.atlassian.sal.api.net.RequestFactory<com.atlassian.sal.api.net.Request<?, com.atlassian.sal.api.net.Response>> requestFactory)
-
-
Method Details
-
getIssue
public RemoteResponse<RemoteJiraIssue> getIssue(com.atlassian.applinks.api.ApplicationLink applicationLink, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion) throws com.atlassian.applinks.api.CredentialsRequiredException, com.atlassian.sal.api.net.ResponseException Description copied from interface:RemoteJiraRestServiceGets the issue with the given key, on the JIRA server given by the application link.- Specified by:
getIssuein interfaceRemoteJiraRestService- Parameters:
applicationLink- the application link of the JIRA serverissueIdOrKey- the issue ID or keyrestVersion- the version of the REST API to invoke- Returns:
- an
RemoteResponsecontaining aRemoteJiraIssueand properties of the HTTP response - Throws:
com.atlassian.applinks.api.CredentialsRequiredException- thrown if authentication is requiredcom.atlassian.sal.api.net.ResponseException- thrown if the response cannot be retrieved
-
getIssue
public RemoteResponse<RemoteJiraIssue> getIssue(String baseUri, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion) throws com.atlassian.applinks.api.CredentialsRequiredException, com.atlassian.sal.api.net.ResponseException Description copied from interface:RemoteJiraRestServiceGets the issue with the given key, on the JIRA server given by the application link.- Specified by:
getIssuein interfaceRemoteJiraRestService- Parameters:
baseUri- the base URI of the JIRA instanceissueIdOrKey- the issue ID or keyrestVersion- the version of the REST API to invoke- Returns:
- an
RemoteResponsecontaining aRemoteJiraIssueand properties of the HTTP response - Throws:
com.atlassian.applinks.api.CredentialsRequiredException- thrown if authentication is requiredcom.atlassian.sal.api.net.ResponseException- thrown if the response cannot be retrieved
-
createRemoteIssueLink
public RemoteResponse<JSONObject> createRemoteIssueLink(com.atlassian.applinks.api.ApplicationLink applicationLink, String remoteIssueKey, Issue issue, String relationship, RemoteJiraRestService.RestVersion restVersion) throws com.atlassian.applinks.api.CredentialsRequiredException, com.atlassian.sal.api.net.ResponseException Description copied from interface:RemoteJiraRestServiceCreates a remote issue link between the given remote issue and the given local issue.- Specified by:
createRemoteIssueLinkin interfaceRemoteJiraRestService- Parameters:
applicationLink- the application link of the remote JIRA serverremoteIssueKey- the issue key of the remote issueissue- the local issuerelationship- the relationship for the linkrestVersion- the version of the REST API to invoke- Returns:
- an
RemoteResponsecontaining aJSONObjectand properties of the HTTP response - Throws:
com.atlassian.applinks.api.CredentialsRequiredException- thrown if authentication is requiredcom.atlassian.sal.api.net.ResponseException- thrown if the response cannot be retrieved
-
requestResource
public RemoteResponse<String> requestResource(com.atlassian.applinks.api.ApplicationLink applicationLink, String resourcePath, Map<String, String> params, RemoteJiraRestService.RestVersion restVersion) throws com.atlassian.applinks.api.CredentialsRequiredException, com.atlassian.sal.api.net.ResponseExceptionDescription copied from interface:RemoteJiraRestServiceRequest the given REST resource on the given JIRA server with the given params.- Specified by:
requestResourcein interfaceRemoteJiraRestService- Parameters:
applicationLink- the application link of the JIRA serverresourcePath- the path of the REST resource, e.g. issueparams- the parameters to add to the requestrestVersion- the version of the REST API to invoke- Returns:
- an
RemoteResponsecontaining theStringresponse and properties of the HTTP response - Throws:
com.atlassian.applinks.api.CredentialsRequiredException- thrown if authentication is requiredcom.atlassian.sal.api.net.ResponseException- thrown if the response cannot be retrieved
-
requestURL
public RemoteResponse<String> requestURL(com.atlassian.applinks.api.ApplicationLink applicationLink, String url, Map<String, String> params) throws com.atlassian.applinks.api.CredentialsRequiredException, com.atlassian.sal.api.net.ResponseExceptionDescription copied from interface:RemoteJiraRestServiceRequest the given URL on the given JIRA server with the given params. The URL does not need to be a REST resource.- Specified by:
requestURLin interfaceRemoteJiraRestService- Parameters:
applicationLink- the application link of the JIRA serverurl- the relative URL to request, from the base URL of the applicationLink, e.g. secure/Dashboard.jspaparams- the parameters to add to the request- Returns:
- an
RemoteResponsecontaining theStringresponse and properties of the HTTP response - Throws:
com.atlassian.applinks.api.CredentialsRequiredException- thrown if authentication is requiredcom.atlassian.sal.api.net.ResponseException- thrown if the response cannot be retrieved
-
buildIssueUrl
-