Interface JiraRestService

All Known Implementing Classes:
JiraRestServiceImpl

public interface JiraRestService
Provide methods for hitting the rest endpoints in a JIRA instance.
  • Method Summary

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

    • doRestCallViaApplink

      @NotNull @NotNull JiraRestResponse doRestCallViaApplink(@NotNull @NotNull com.atlassian.applinks.api.ApplicationLink applicationLink, String requestUrl, com.atlassian.sal.api.net.Request.MethodType methodType, @Nullable @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 @NotNull JiraRestResponse doRestCallViaApplink(@NotNull @NotNull com.atlassian.applinks.api.ApplicationLink applicationLink, String requestUrl, com.atlassian.sal.api.net.Request.MethodType methodType, @Nullable @Nullable com.opensymphony.webwork.dispatcher.json.JSONObject data, @Nullable @Nullable 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 @NotNull com.opensymphony.webwork.dispatcher.json.JSONObject getRemoteIssueLinkJson(@NotNull @NotNull String globalIdPostfix, @NotNull @NotNull String text, @NotNull @NotNull String key, @NotNull @NotNull String relationship, @NotNull @NotNull String relativeUrl, 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