You can no longer publish Connect apps on the Atlassian Marketplace. All new extensibility features will be delivered only on Forge.
Refer to this blog post for our timeline to end Connect support.
Have an existing Connect app? You can incrementally migrate it to Forge.
A webhook is a standard mechanism for an add-on to listen to in-product events via HTTP callbacks. An add-on can register a webhook in the Atlassian Connect descriptor to listen to events that are fired by Jira or Confluence.
Just to give you an idea of how you can use them in add-ons, here are a few sample webhook events:
If your add-on uses webhooks, you must declare the "read" scope in your atlassian-connect.json descriptor.
To receive webhook events, your add-on needs to include the webhook module declaration in its JSON descriptor. The declaration indicates the add-on relative URL at which it will receive the notification. In other words, the Atlassian application will send an HTTP POST to this resource in response to an application event. The add-on code that handles the POST should process any information passed in the body of the message, as appropriate. Each webhook POST sent to the add-on will also include the authentication headers that allow the add-on to validate the authenticity of that request. Specifically, the JWT token can be found in the "Authorization" HTTP header.
Note that if using Apache and mod_wsgi to serve files to a Django application, the Authentication header is stripped out by default. Extra configuration is required to ensure the Authentication header is visible.
Important: It must be noted that webhook delivery is not guaranteed; it is best effort. When a webhook event is triggered in Jira or Confluence instance then a single HTTP POST is sent to your add-on. If your add-on is down, or there is any network problems between the Atlassian product and your add-on, then you will never receive the webhook event. In general, webhooks are quite reliable; however you must always keep in mind that delivery is not guaranteed.
Jira webhooks also provide a way to add and substitute variables in the url. This is similar to context parameters for add-ons. See context parameters.
For example, if we register to listen for one of the project events with a url containing {project.id}, a POST message will
be sent to the address with the {project.id} replaced by the id of the project that the event was triggered for.
Issue-related events may be filtered with JQL. Webhooks will be sent only for issues matched by the provided JQL query.
Here is an example JQL query that can be put into the "filter" property: "project = TEST AND fixVersion = future".
JQL filtering is supported only by the following event types:
jira:issue_createdjira:issue_deletedjira:issue_updatedcomment_createdcomment_updatedcomment_deletedissue_property_setissue_property_deletedworklog_createdworklog_updatedworklog_deletedBelow is a list of all available webhook events.
connect_addon_disabledconnect_addon_enabledjira:issue_createdjira:issue_deletedjira:issue_updatedThe supported context parameters are {project.id}, {project.key}, {issue.key}, {issue.id}.
issuelink_createdissuelink_deletedThe supported context parameters are {destinationIssue.key}, {destinationIssue.id}, {destinationProject.key}, {destinationProject.id}, {sourceIssue.key}, {sourceIssue.id}, {sourceProject.key}, {sourceProject.id}.
filter_createdfilter_updatedfilter_deletedThere is one supported context parameter: {filter.id}.
issue_property_setissue_property_deletedThe supported context parameters are {project.id}, {project.key}, {issue.key}, {issue.id}.
issuetype_createdissuetype_updatedissuetype_deletedThe supported context parameters are {project.id}, {project.key}, {issuetype.id}.
attachment_createdattachment_deletedThe supported context parameters are {attachment.id}, {project.id}, {project.key}, {issue.key}, {issue.id}.
jira:version_createdjira:version_deletedjira:version_mergedjira:version_updatedjira:version_movedjira:version_releasedjira:version_unreleasedThe supported context parameters are {project.id}, {project.key}, {version.id}.
Special context parameter for version_merged event is {mergedVersion.id}.
project_createdproject_updatedproject_deletedThe supported context parameters are {project.id}, {project.key}
project_app_enabledproject_app_disabledThe supported context parameters are {project.id}, {project.key}, {app.key}
user_createduser_deleteduser_updatedThe supported context parameters are {modifiedUser.accountId}, {modifiedUser.name} (deprecated), {modifiedUser.key} (deprecated)
option_voting_changedoption_watching_changedoption_unassigned_issues_changedoption_subtasks_changedoption_issuelinks_changedoption_timetracking_changedcomment_createdcomment_updatedcomment_deletedThe supported context parameters are {project.id}, {project.key}, {issue.key}, {issue.id}, {comment.id}.
worklog_createdworklog_updatedworklog_deletedThe supported context parameters are {project.id}, {project.key}, {issue.key}, {issue.id}, {worklog.id}.
attachment_archivedattachment_createdattachment_removedattachment_restoredattachment_trashedattachment_unarchivedattachment_updatedattachment_viewedblog_createdblog_movedblog_removedblog_restoredblog_trashedblog_updatedblog_viewedblueprint_page_createdcomment_removedconnect_addon_disabledconnect_addon_enabledcontent_createdcontent_removedcontent_restoredcontent_trashedcontent_updatedcontent_permissions_updatedgroup_createdgroup_removedlabel_addedlabel_createdlabel_deletedlabel_removedpage_archivedpage_children_reorderedpage_createdpage_initializedpage_copiedpage_movedpage_removedpage_restoredpage_trashedpage_unarchivedpage_updatedpage_startedpage_snapshottedpage_publishedpage_viewedrelation_createdrelation_deletedsearch_performedspace_createdspace_logo_updatedspace_permissions_updatedspace_removedspace_updatedtheme_enableduser_reactivateduser_removed1 2POST /jira-issue_created?user_id=admin&user_key=admin HTTP/1.1 Authorization: JWT ... Atlassian-Connect-Version: x.x Content-Type: application/json { timestamp: 1426661049725, webhookEvent: 'jira:issue_created', ... }
All webhooks will post JSON data to the listening add-on. The structure of this JSON differs based on the Atlassian product that sent the event and the event itself. Here are some example webhook events:
All webhook events that are sent because of Jira issue updates will have the following structure.
1 2{ "timestamp" "event" "user": { // See User shape in the linked document }, "issue": { // See Issue shape in the linked document }, "changelog" : { // See Changelog shape in the linked document }, "comment" : { // See Comment shape in in the linked document } }
This is fully documented in Webhooks: Example callback for an issue-related event.
1 2{ "userAccountId": "ff80808154510724015451074c160001", "accountType": "customer", "page": { "creatorAccountId": 'ff80808154510724015451074c160001', "spaceKey": "~admin", "modificationDate": 1471926079631, "lastModifierAccountId": "ff80808154510724015451074c160001", "self": "https://cloud-development-environment.atlassian.net/wiki/display/~admin/Some+random+test+page", "id": 16777227, "title": "Some random test page", "creationDate": 1594752539309, "contentType": "page", "version": 1 }, "timestamp": 1471926079645 }
This is fully documented in Using webhooks
1 2{ "userAccountId": "ff80808154510724015451074c160001", "accountType": "customer", "comment": { "creatorAccountId": "ff80808154510724015451074c160001", "spaceKey": "~admin", "parent": { "creatorAccountId": "ff80808154510724015451074c160001", "spaceKey": "~admin", "modificationDate": 1471926079631, "lastModifierAccountId": "ff80808154510724015451074c160001", "self": "https://cloud-development-environment.atlassian.net/wiki/display/~admin/Some+random+test+page", "id": 16777227, "title": "Some random test page", "creationDate": 1471926079631, "contentType": "page", "version": 1 }, "modificationDate": 1471926091465, "lastModifierAccountId": "ff80808154510724015451074c160001", "self": "https://cloud-development-environment/wiki/display/~admin/Some+random+test+page?focusedCommentId=16777228#comment-16777228", "id": 16777228, "creationDate": 1471926091465, "contentType": "comment", "version": 1 }, "timestamp": 1471926091468 }
Each type of webhook event includes information specific to that event in the body content of the POST message. The add-on resource that listens for webhook posts should receive and process the content as appropriate for the add-on.
1 2{ "modules": { "webhooks": [ { "event": "jira:issue_created", "url": "/issue-created", "excludeBody": false, "filter": "project = HSA", "propertyKeys": [ "propertyKey", "otherPropertyKey" ] } ] } }
| Type | string |
| Max length | 100 |
| Required | Yes |
| Description |
Specifies the named event you would like to listen to (e.g., "enabled", "jira:issue_created", etc.) |
| Type | string |
| Format | uri-template |
| Required | Yes |
| Description |
Specifies your add-on's POST webhook handler URL. This property must be a URL relative to the add-on's baseUrl. |
| Type | Single Condition, Composite Condition... |
| Description | Conditions can be added to display only when all the given conditions are true. |
Currently, we only support the addon_is_licensed condition.
| Type | boolean |
| Defaults to | false |
| Description |
Specifies if webhook will send JSON body when triggered. By default, a webhook will send a request with a JSON body. |
| Type | string |
| Max length | 10000 |
| Description |
Filter for entities that the webhook will be triggered for. Refer to the documentation on filtering for details. |
| Type | string |
| Max length | 100 |
| Pattern | ^[a-zA-Z0-9-]+$ |
| Description |
A key to identify this module. Required when registering the module dynamically, otherwise ignored. |
| Type | [string,...] |
| Description |
Specifies entity properties which will be returned inside JSON body. If not specified no properties will be returned. Currently this is supported only in Jira webhooks, for all events that support Entity Properties. Note that properties won't be returned for entity-deleted events, since the properties are already deleted by the time the webhook is sent. |
Rate this page: