Webhook events

Brahim ESSALIH November 15, 2016

Hello everybody,

I'm trying to use webhooks in my Atlassian connect addon. I add this snippet in my descriptor.json and it works

....
"webhooks": [
			{
				"name": "test",
				 "events": "jira:issue_updated",
				"filter": "project = test",
				"url": "/mainIssue",
				"excludeBody": false
			}
		]


I need to add "jira:issue_created" also without duplicating the code I tried this but it doesn't work 

"webhooks": [
			{
				"name": "test",
				 "events": [
				      "jira:issue_updated",
				      "jira:issue_created"
				    ],
				"filter": "project = test",
				"url": "/mainIssue",
				"excludeBody": false
			}
		]

 Would you have any proposition how I can specify more events ?

 

Best regards

1 answer

3 votes
Jon Bevan [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2016

Hi,

You need to specify a new webhook object for each event:

....
"webhooks": [
            {
                "name": "test updated",
                 "events": "jira:issue_updated",
                "filter": "project = test",
                "url": "/mainIssue",
                "excludeBody": false
            },
            {
                "name": "test created",
                 "events": "jira:issue_created",
                "filter": "project = test",
                "url": "/mainIssue",
                "excludeBody": false
            }
        ]

Thanks,

Jon

Brahim ESSALIH November 15, 2016

Thanks @Jon Bevan [Adaptavist] that's what I want to avoid it. That's mean that I will duplicate the code. But if there is not any way I will do like that

Suggest an answer

Log in or Sign up to answer