Why POST [domain].atlassian.net/rest/webhooks/1.0/webhooks return only previously created webhooks

Damian Sowiński October 27, 2020

Hello,
I met issue with registering webhooks via rest API.
I make POST request to [domain].atlassian.net/rest/webhooks/1.0/webhooks

with sample body:

{

"name": "my first webhook via rest",

"url": "https://www.example.com/webhooks",

"events": [

"jira:issue_created", "jira:issue_updated"

],

  "excludeIssueDetails" : false

}
And i get 200 response with previously created webhooks via Admin panel and new webhook isn't registered.

Thanks in advance for responses


Grettings
Damian

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2020

Hello @Damian Sowiński

Welcome to the Atlassian Community!

Creating a webhook via REST API, if successful, is returning status  code 201 followed by the information about the webhook you just created (and not the previous ones).

I have just tested this and it works fine for me on 2 different Jira instances (free and standard):

curl -u <EMAIL-ADDRESS>:<API-TOKEN> -D- -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"name":"webhook via rest","url":"https://www.example.com/webhooks","events":["jira:issue_created","jira:issue_updated"],"excludeIssueDetails":false}' -X POST "https://<NAME>.atlassian.net/rest/webhooks/1.0/webhook"

HTTP/2 201
server: AtlassianProxy/1.15.8.1
.......


{"name":"webhook via rest","url":"https://www.example.com/webhooks","excludeBody":false,"filters":{"issue-related-events-section":""},"events":["jira:issue_updated","jira:issue_created"],"enabled":true,"payloadVersion":"V2","self":"https://<NAME>.atlassian.net/rest/webhooks/1.0/webhook/1"........}

 Webhoos-via-REST.jpg

 

 

If you are getting a different behavior, can you kindly run the same test with curl and paste the result in your reply hiding the sensitive data as I did above?

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events