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
Community moderators have prevented the ability to post new answers.
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"........}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.