Hello there,
I've looked through every similar topic here in the forums, and couldn't really find anything that would help me.
I've built 3LO integration with my product, and adding webhooks via rest API. Hooks are created and I can list them:
[{'id': 10002,
'jqlFilter': 'project = "STAG" AND issuetype = Epic',
'events': ['jira:issue_updated', 'jira:issue_created', 'jira:issue_deleted'],
'expirationDate': '2021-09-08T15:45:58.616+0300'},
{'id': 10003,
'jqlFilter': 'project = "STAG"',
'events': ['jira:issue_updated', 'jira:issue_created', 'jira:issue_deleted'],
'expirationDate': '2021-09-08T15:51:37.608+0300'},
{'id': 10004,
'jqlFilter': 'issuetype = Epic',
'events': ['jira:issue_updated', 'jira:issue_created', 'jira:issue_deleted'],
'expirationDate': '2021-09-08T16:12:31.343+0300'}]
Made 3 similar looking webhooks as I thought I had a problem with jql, however when I execute it I get the correct list of epics.
Whenever I try to update, delete, or create an epic, nothing happens. Not getting any callbacks from Jira.
For the sake of testing I am using https://requestbin.net service which works fine (sent it several requests and saw them in the log).
Hello @Artiom Vasiliev ,
If I understand correctly, you have created some Webhooks using JQL filters via REST API and they are correctly created, but are not fired.
If my understanding is correct, can you kindly let me know the following:
Otherwise, in case my understanding is not correct, please provide more details.
Cheers,
Dario
Hi Dario, thanks for a detailed reply. Here's the info:
[{"name":"New Webhook Listener","url":"https://requestbin.net/r/e7q4yq4l","excludeBody":false,"filters":{"issue-related-events-section":""},"events":["worklog_created","option_unassigned_issues_changed","comment_updated","user_created","attachment_created","jira:version_created","board_configuration_changed","issue_property_set","project_deleted","sprint_created","comment_deleted","option_issuelinks_changed","project_updated","jira:issue_updated","project_archived","issue_property_deleted","sprint_updated","option_voting_changed","comment_created","option_timetracking_changed","project_soft_deleted","option_attachments_changed","jira:issue_created","issuelink_deleted","jira:issue_deleted","sprint_deleted","project_restored_deleted","attachment_deleted","project_created","option_watching_changed","issuelink_created","jira:version_unreleased","board_created","jira:version_moved","project_restored_archived","sprint_closed","user_updated","jira:version_released","jira:version_deleted","option_timetracking_provider_changed","sprint_started","jira:version_merged","worklog_deleted","option_subtasks_changed","jira:version_updated","worklog_updated","user_deleted","board_updated"],"enabled":true,"self":"https://getshipit.atlassian.net/rest/webhooks/1.0/webhook/4","lastUpdatedUser":"shipzdik","lastUpdatedDisplayName":"Artjom Vassiljev","lastUpdated":1629105245598}Doing the same for 3LO app, I get a different list of webhooks, the ones I created programmatically:
[{'id': 10006,
'jqlFilter': 'project = STAG AND issuetype = Epic',
'events': ['jira:issue_updated', 'jira:issue_created',
'expirationDate': '2021-09-15T12:10:00.781+0300'},
{'id': 10007,
'jqlFilter': 'issuetype = Epic',
'events': ['jira:issue_updated', 'jira:issue_created',
'expirationDate': '2021-09-15T12:11:56.384+0300'}]
I couldn't find any information whether webhooks is available on specific plans only or on free as well. We're on the free plan, but most of our clients for whom we're doing the integration are on paid plans.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Allow me to step in for Dario while he is away. Thanks for providing all these details, it really helps to see the scope of the problem here. I came across a documented bug here over in https://jira.atlassian.com/browse/JRACLOUD-67911 that I think relates to this problem.
It appears that the documentation we have regarding the json formatting for how a JQL filter is created programmatically is currently incorrect. Please note that the JQL for this kind of webhook now appears to be slightly different than the JQL used within Jira for making that search.
So for example, your payload contains the string:
'jqlFilter': 'project = STAG AND issuetype = Epic'
But I believe this needs to be adjusted to look more like this:
"filters": { "issue-related-events-section": "STAG AND issuetype = Epic"}
Try this instead and let me know if this helps. My apologies that the documentation appears to be lacking here, I will reach out to my team to see if we can clarify this.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Andy Heinzer and @Dario B, sadly this didn't work as I hoped for. Getting an error back that says the "filters" field is unrecognized:
{
"errorMessages":["Unrecognized field \"filters\" (Class com.atlassian.jira.rest.v2.webhook.DynamicWebhookRegistrationConfiguration), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@51879649; line: 1, column: 262] (through reference chain: com.atlassian.jira.rest.v2.webhook.DynamicWebhookRegistrationConfiguration[\"filters\"])"]
}
Initially I thought this was related to the API v2 which I'm using, but switching to v3 or latest (e.g. /rest/api/latest/webhook) returned the same error.
Also looking at the open API schema (https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json), I can't find any "filters", it's in fact "jqlFilter":
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andy Heinzer, @Dario B I finally made it work, and the culprit is somewhat embarassing...
tldr: The endpoint for testing I was using (requestbin.net) didn't accept requests from Atlassian, and swithing it to another one solved everything!
I went all the way through signing up for a new account, trying old Rest API (i.e. /webhooks/1.0/webhook), re-creating system webhooks via UI. It was adding webhooks, but never hitting my endpoint. So out of desperation I decided to try another service for debugging HTTP requests, and wonderfully that one worked!
The reason I didn't rule out requestbin.net in the first place is that issuing requests from my terminal worked without any problems, I could see them getting accepted.
The documentation regarding "jqlFilter" is correct though :)
Thanks a lot for your help guys!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Artiom Vasiliev ,
Could you please elaborate on the Solution , since I too got stucked with the same issue.
Note:
I am getting triggers when the webhooks are configured directly in UI.
I have tried registering through REST API with the same Url which I have used in UI but not receiving the triggers
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.