java.lang.Object
com.atlassian.jira.cloud.jenkins.common.client.JiraApi

public class JiraApi extends Object
Common HTTP client to talk to Jira Build and Deployment APIs in Jira
  • Constructor Details

    • JiraApi

      @Inject public JiraApi(okhttp3.OkHttpClient httpClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, String apiUrl)
  • Method Details

    • postUpdate

      public <ResponseEntity> PostUpdateResult<ResponseEntity> postUpdate(String cloudId, String accessToken, String clientId, JiraRequest jiraRequest, Class<ResponseEntity> responseClass)
      Submits an update to the Atlassian Builds or Deployments API and returns the response
      Type Parameters:
      ResponseEntity - Response entity, which can be either BuildApiResponse or DeploymentApiResponse
      Parameters:
      cloudId - Jira Cloud Id
      accessToken - Access token generated from Atlassian API
      clientId - oAuth client id
      jiraRequest - An assembled payload to be submitted to Jira
      Returns:
      Response from the API
    • getResult

      public <ResponseEntity> PostUpdateResult<ResponseEntity> getResult(String accessToken, Map<String,String> pathParams, String clientId, Class<ResponseEntity> responseClass)
      Submits an update to the Atlassian Builds or Deployments API and returns the response
      Type Parameters:
      ResponseEntity - Response entity, which can be either BuildApiResponse or DeploymentApiResponse
      Parameters:
      accessToken - Access token generated from Atlassian API
      pathParams - Params to be injected to the url
      Returns:
      Response from the API