com.atlassian.bamboo.jira.rest
Interface JiraRestService

All Known Implementing Classes:
JiraRestServiceImpl

public interface JiraRestService

Provide methods for hitting the rest endpoints in a JIRA instance.


Method Summary
 JiraRestResponse doRestCallViaApplink(com.atlassian.applinks.api.ApplicationLink applicationLink, java.lang.String requestUrl, com.atlassian.sal.api.net.Request.MethodType methodType, com.opensymphony.webwork.dispatcher.json.JSONObject data)
          Perform a rest call to JIRA.
 JiraRestResponse doRestCallViaApplink(com.atlassian.applinks.api.ApplicationLink applicationLink, java.lang.String requestUrl, com.atlassian.sal.api.net.Request.MethodType methodType, com.opensymphony.webwork.dispatcher.json.JSONObject data, java.lang.Class<? extends com.atlassian.applinks.api.auth.AuthenticationProvider> providerClass)
          Perform a rest call to JIRA.
 com.opensymphony.webwork.dispatcher.json.JSONObject getRemoteIssueLinkJson(java.lang.String globalIdPostfix, java.lang.String text, java.lang.String key, java.lang.String relationship, java.lang.String relativeUrl, java.lang.String icon)
          Generate the JsonData representing an Issue link.
 

Method Detail

doRestCallViaApplink

@NotNull
JiraRestResponse doRestCallViaApplink(@NotNull
                                              com.atlassian.applinks.api.ApplicationLink applicationLink,
                                              java.lang.String requestUrl,
                                              com.atlassian.sal.api.net.Request.MethodType methodType,
                                              @Nullable
                                              com.opensymphony.webwork.dispatcher.json.JSONObject data)
                                      throws CredentialsRequiredContextException
Perform a rest call to JIRA. Will use application/json content type. Will Perform extra validation for whether jira server is < 5.0 IFF the request 404s

Parameters:
applicationLink - for the JIRA instance you are going to call
requestUrl - url to hit, relative to the JIRA server defined in the app link.
methodType - http method type
data - optional data to be included in the request
Returns:
JiraRestResponse containing errors and response as JSON if possible.
Throws:
CredentialsRequiredContextException - if oauth dance required

doRestCallViaApplink

@NotNull
JiraRestResponse doRestCallViaApplink(@NotNull
                                              com.atlassian.applinks.api.ApplicationLink applicationLink,
                                              java.lang.String requestUrl,
                                              com.atlassian.sal.api.net.Request.MethodType methodType,
                                              @Nullable
                                              com.opensymphony.webwork.dispatcher.json.JSONObject data,
                                              @Nullable
                                              java.lang.Class<? extends com.atlassian.applinks.api.auth.AuthenticationProvider> providerClass)
                                      throws CredentialsRequiredContextException
Perform a rest call to JIRA. Will use application/json content type. Will Perform extra validation for whether jira server is < 5.0 IFF the request 404s

Parameters:
applicationLink - for the JIRA instance you are going to call
requestUrl - url to hit, relative to the JIRA server defined in the app link.
methodType - http method type
data - optional data to be included in the request
providerClass - declares that you want a specific AuthenticationProvider to be used, instead of the default one
Returns:
JiraRestResponse containing errors and response as JSON if possible.
Throws:
CredentialsRequiredContextException - if oauth dance required
Since:
5.0

getRemoteIssueLinkJson

@NotNull
com.opensymphony.webwork.dispatcher.json.JSONObject getRemoteIssueLinkJson(@NotNull
                                                                                   java.lang.String globalIdPostfix,
                                                                                   @NotNull
                                                                                   java.lang.String text,
                                                                                   @NotNull
                                                                                   java.lang.String key,
                                                                                   @NotNull
                                                                                   java.lang.String relationship,
                                                                                   @NotNull
                                                                                   java.lang.String relativeUrl,
                                                                                   java.lang.String icon)
                                                                           throws com.opensymphony.webwork.dispatcher.json.JSONException
Generate the JsonData representing an Issue link. Can be used in rest request to create issue link.

Parameters:
globalIdPostfix - text to uniquely identify this Remote Issue Link to prevent the same link being added multiple times to one issue. Will get refixed with appId.
text - this is the text that will display in the issue link (after we do our permissioning magic on the jira side)
key - this is technically the summary, but is also the key that the jira side will use to grab latest status e.g. planResultKey or planKey. Will also get displayed whilst trying to verify permissions.
relationship - this is the text that displays before the Issue Link, defining the relationship between the issue and what its linked to.
relativeUrl - this is the url in Bamboo you want the remote link to link to.
icon - this is the full path to the icon to be displayed next to the link. Most probably this will be a link to the icon on the JIRA Server.
Returns:
JsonObject representing the Remote Issue Link.
Throws:
com.opensymphony.webwork.dispatcher.json.JSONException


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.