Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to Create Webhooks via API in Forge App

PgM Innovations June 18, 2024

 

I'm having trouble creating webhooks using the Jira REST API within my Forge app. Here is the request I'm making:

const webhookPayload = {

    name: "Sprint Updated Webhook",

    enabled: true,

    description: "Webhook for getting sprint updates",

    url: webhookUrl,

    events: [

        "jira:sprint_created",

        "jira:sprint_updated",

        "jira:sprint_deleted"

    ],

    excludeBody: false,

    secret: null,

    filters: {"issue-related-events-section": ""},

    lastUpdatedDisplayName: "",

    lastUpdatedUse: ""

};

 

const response = await api.asApp().requestJira(route`/rest/webhooks/1.0/webhook`, {

    method: 'POST',

    body: JSON.stringify(webhookPayload),

    headers: {

        'Content-Type': 'application/json'

    }

});

Despite this, I'm not seeing the webhook being created in my Jira instance. Here are some additional details:

  • The webhookUrl is correctly set to the URL that handles the webhook events.
  • I have the necessary permissions in my manifest.yml
    permissions:
  •   scopes:
  •     - read:jira-work
  •     - write:jira-work
  •     - manage:jira-webhook

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events