Class JiraRestServiceImpl

    • Method Detail

      • doRestCallViaApplink

        @NotNull
        public @NotNull JiraRestResponse doRestCallViaApplink​(@NotNull
                                                              @NotNull com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                              @NotNull
                                                              @NotNull String requestUrl,
                                                              @NotNull
                                                              com.atlassian.sal.api.net.Request.MethodType methodType,
                                                              @Nullable
                                                              @Nullable com.opensymphony.webwork.dispatcher.json.JSONObject data)
                                                       throws CredentialsRequiredContextException
        Description copied from interface: JiraRestService
        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
        Specified by:
        doRestCallViaApplink in interface JiraRestService
        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
        public @NotNull JiraRestResponse doRestCallViaApplink​(@NotNull
                                                              @NotNull com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                              @NotNull
                                                              @NotNull String requestUrl,
                                                              @NotNull
                                                              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
        Description copied from interface: JiraRestService
        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
        Specified by:
        doRestCallViaApplink in interface JiraRestService
        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
      • getRemoteIssueLinkJson

        @NotNull
        public @NotNull com.opensymphony.webwork.dispatcher.json.JSONObject getRemoteIssueLinkJson​(@NotNull
                                                                                                   @NotNull String globalId,
                                                                                                   @NotNull
                                                                                                   @NotNull String text,
                                                                                                   @NotNull
                                                                                                   @NotNull String key,
                                                                                                   @NotNull
                                                                                                   @NotNull String relationship,
                                                                                                   @NotNull
                                                                                                   @NotNull String relativeUrl,
                                                                                                   String iconLocation)
                                                                                            throws com.opensymphony.webwork.dispatcher.json.JSONException
        Description copied from interface: JiraRestService
        Generate the JsonData representing an Issue link. Can be used in rest request to create issue link.
        Specified by:
        getRemoteIssueLinkJson in interface JiraRestService
        Parameters:
        globalId - 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.
        iconLocation - 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