Class GlobalWebhooksResource

java.lang.Object
com.atlassian.jira.plugins.webhooks.rest.GlobalWebhooksResource

@Consumes("application/json") @Produces("application/json") @Path("webhooks") public class GlobalWebhooksResource extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GlobalWebhooksResource(com.atlassian.sal.api.message.I18nResolver i18nResolver, com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer, com.atlassian.webhooks.WebhookService webhookService, com.atlassian.webhooks.history.InvocationHistoryService invocationHistoryService, WorkflowUtil workflowUtil, JqlValidator jqlValidator, JiraWebhookAuditingHandler auditingHandler)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    javax.ws.rs.core.Response
    createWebhook(javax.ws.rs.core.UriInfo uriInfo, com.atlassian.webhooks.internal.rest.RestWebhook webhook)
    Create a webhook via the URL.
    javax.ws.rs.core.Response
    deleteWebhook(int webhookId)
    Delete a webhook via the URL.
    javax.ws.rs.core.Response
    findWebhooks(javax.ws.rs.core.UriInfo uriInfo, List<String> events, boolean statistics, int start, int limit)
    Find webhooks.
    javax.ws.rs.core.Response
    getLatestInvocation(int webhookId, String eventId, Set<String> outcomes)
    Get the latest invocations for a specific webhook.
    javax.ws.rs.core.Response
    getStatistics(int webhookId, String eventId)
    Get the statistics for a specific webhook.
    javax.ws.rs.core.Response
    getStatisticsSummary(int webhookId)
    Get the statistics summary for a specific webhook.
    javax.ws.rs.core.Response
    getTransitions(int id, boolean statistics)
     
    javax.ws.rs.core.Response
    getWebhook(int webhookId, boolean statistics)
    Get a webhook by id.
    javax.ws.rs.core.Response
    updateWebhook(javax.ws.rs.core.UriInfo uriInfo, int webhookId, com.atlassian.webhooks.internal.rest.RestWebhook webhook)
    Update an existing webhook.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • GlobalWebhooksResource

      @Inject public GlobalWebhooksResource(com.atlassian.sal.api.message.I18nResolver i18nResolver, com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer, com.atlassian.webhooks.WebhookService webhookService, com.atlassian.webhooks.history.InvocationHistoryService invocationHistoryService, WorkflowUtil workflowUtil, JqlValidator jqlValidator, JiraWebhookAuditingHandler auditingHandler)
  • Method Details

    • createWebhook

      @POST public javax.ws.rs.core.Response createWebhook(@Context javax.ws.rs.core.UriInfo uriInfo, com.atlassian.webhooks.internal.rest.RestWebhook webhook)
      Create a webhook via the URL.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      webhook - the webhook to be created
    • deleteWebhook

      @DELETE @Path("/{webhookId}") public javax.ws.rs.core.Response deleteWebhook(@PathParam("webhookId") int webhookId)
      Delete a webhook via the URL.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      webhookId - the id of the webhook to be deleted.
    • findWebhooks

      @GET public javax.ws.rs.core.Response findWebhooks(@Context javax.ws.rs.core.UriInfo uriInfo, @QueryParam("event") List<String> events, @QueryParam("statistics") @DefaultValue("false") boolean statistics, @QueryParam("start") int start, @QueryParam("limit") @DefaultValue("10000") int limit)
      Find webhooks.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      events - list of WebhookEvent ids to filter for
      statistics - true if statistics should be provided for all found webhooks
    • getLatestInvocation

      @GET @Path("/{webhookId}/latest") public javax.ws.rs.core.Response getLatestInvocation(@PathParam("webhookId") int webhookId, @QueryParam("event") String eventId, @QueryParam("outcome") Set<String> outcomes)
      Get the latest invocations for a specific webhook.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      webhookId - id of the webhook
      eventId - the string id of a specific event to retrieve the last invocation for.
      outcomes - the outcome to filter for. Can be SUCCESS, FAILURE, ERROR. None specified means that the all will be considered
    • getStatistics

      @GET @Path("/{webhookId}/statistics") public javax.ws.rs.core.Response getStatistics(@PathParam("webhookId") int webhookId, @QueryParam("event") String eventId)
      Get the statistics for a specific webhook.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      webhookId - id of the webhook
      eventId - the string id of a specific event to retrieve the last invocation for. May be empty, in which case all events are considered
    • getStatisticsSummary

      @GET @Path("/{webhookId}/statistics/summary") public javax.ws.rs.core.Response getStatisticsSummary(@PathParam("webhookId") int webhookId)
      Get the statistics summary for a specific webhook.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      webhookId - id of the webhook
    • getWebhook

      @GET @Path("/{webhookId}") public javax.ws.rs.core.Response getWebhook(@PathParam("webhookId") int webhookId, @QueryParam("statistics") @DefaultValue("false") boolean statistics)
      Get a webhook by id.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      webhookId - id of the webhook
    • updateWebhook

      @PUT @Path("/{webhookId}") public javax.ws.rs.core.Response updateWebhook(@Context javax.ws.rs.core.UriInfo uriInfo, @PathParam("webhookId") int webhookId, com.atlassian.webhooks.internal.rest.RestWebhook webhook)
      Update an existing webhook.

      The authenticated user must be an administrator to call this resource.

      Parameters:
      webhookId - the existing webhook id
      webhook - the representation of the updated values for the webhook
    • getTransitions

      @GET @Path("{id}/transitions") public javax.ws.rs.core.Response getTransitions(@PathParam("id") int id, @QueryParam("statistics") @DefaultValue("false") boolean statistics)