The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Create Webhooks via API in Forge App

PgM Innovations Support Team
Atlassian Partner
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events