Rate this page:
Product events are generated when users perform actions in Atlassian products. App's can subscribe to a list of product events using a trigger in the manifest.
Events are passed to your app via the event
parameter.
1 2 3 4
export async function run(event, context) {
console.log('event: ' + JSON.stringify(event));
return true;
}
Event names follow the format: avi:activity:<eventType>:<objectType>
.
The table below describes the fields contained in an event.
Field | Type | Description |
---|---|---|
accountId | string | User ID. |
activityItem.eventType | enum | Event type. |
activityItem.object | ActivityObject | Object (issue, page and alike). |
activityItem.object.id | string | Object ID. |
activityItem.object.name | string | Object name. |
activityItem.object.type | enum | Object type. |
activityItem.object.product | enum | Object product. |
activityItem.object.url and activityItem.object.iconUrl | string | Object URLs (url, restUrl, iconUrl). |
activityItem.containers | Array<ActivityObject> | A list of containers associated with the object. |
activityItem.contributors | Array<ActivityContributor> | List of contributors. |
Below you can see examples from both Jira and Confluence product events.
Forge apps can subscribe to these Jira events.
Event name | Description |
---|---|
avi:activity:created:issue | An issue was created. |
avi:activity:updated:issue | An issue was updated. |
avi:activity:viewed:issue | An issue was viewed. |
avi:activity:assigned:issue | An issue was assigned. |
avi:activity:unassigned:issue | An issue was unassigned. |
avi:activity:transitioned:issue | An issue’s status was transitioned. |
The example below shows an avi:activity:viewed:issue
Jira event.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
{
"type": "avi:activity:viewed:issue",
"schema": "ari:cloud:platform-services::worklens/activity",
"payload": {
"accountId": "123057:5cb5312f-1136-422f-92f7-b077349b5xyz",
"activityItem": {
"id": "YXJpOmNsb3VkOmFjdGl2aXR5OmFmNzZkOGE0LWM3OTQtNDk4Yy05NzMxLWMyMTQ4ODc5YzRiZjppdGVtL1lYSnBPbU5zYjNWa09tcHBjbUU2WVdZM05tUTRZVFF0WXpjNU5DMDBPVGhqTFRrM016RXRZekl4TkRnNE56bGpOR0ptT21semMzVmxMelEwT0RCOE1qQXhPUzB3T0MweE5WUXdOem93TURvMU9TNDJNREphZkZaSlJWZEZSQT09",
"timestamp": "2019-08-15T07:00:59.602Z",
"eventType": "VIEWED",
"object": {
"id": "YXJpOmNsb3VkOmppcmE6YWY3NmQ4YTQtYzc5NC00OThjLTk3MzEtYzIxNDg4NzljNGJmOmlzc3VlLzQ0ODA=",
"localResourceId": "4480",
"name": "KEY-789 There is an issue with 4480",
"type": "ISSUE",
"product": "JIRA",
"cloudID": "af76d8a4-c794-498c-9731-c2148879c4bf",
"url": "https://example.atlassian.net/browse/KEY-789",
"iconURL": "https://example.com/icon.svg"
},
"containers": [
{
"id": "YWY3NmQ4YTQtYzc5NC00OThjLTk3MzEtYzIxNDg4NzljNGJm",
"localResourceId": "af76d8a4-c794-498c-9731-c2148879c4bf",
"type": "SITE",
"product": "JIRA",
"cloudID": "af76d8a4-c794-498c-9731-c2148879c4bf",
"url": "https://example.atlassian.net"
},
{
"id": "YXJpOmNsb3VkOmppcmE6YWY3NmQ4YTQtYzc5NC00OThjLTk3MzEtYzIxNDg4NzljNGJmOnByb2plY3QvNjE4",
"localResourceId": "618",
"name": "project",
"type": "PROJECT",
"product": "JIRA",
"cloudID": "af76d8a4-c794-498c-9731-c2148879c4bf",
"url": "https://example.atlassian.net/projects/KEY"
}
],
"contributors": [
{
"profile": {
"accountId": "123057:5cb5312f-1136-422f-92f7-b077349b5xyz"
}
},
{
"profile": {
"accountId": "123057:711ade1d-30f7-4568-b36b-844f96bf942a"
}
}
]
}
},
"resource": "ari:cloud:jira:af76d8a4-c794-498c-9731-c2148879c4bf:issue/4480"
}
Forge apps can subscribe to these Confluence events.
Event name | Description |
---|---|
avi:activity:published:page | A page was published. |
avi:activity:published:blogpost | A blogpost was published. |
avi:activity:viewed:page | A page was viewed. |
avi:activity:viewed:blogpost | A blogpost was viewed. |
avi:activity:liked:page | A page was liked. |
avi:activity:liked:blogpost | A blogpost was liked. |
avi:activity:commented:page | A page was commented on. |
avi:activity:commented:blogpost | A blogpost was commented on. |
The example below shows an avi:activity:viewed:page
Confluence event.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
{
"accountId": "123057:5cb5312f-1136-422f-92f7-b077349b5xyz",
"activityItem": {
"id": "YXJpOmNsb3VkOmFjdGl2aXR5OmMwYmE1NTM4LTZiOTQtNDdkOS05Y2JjLTEyMWFmNjU5YzA1MzppdGVtL1lYSnBPbU5zYjNWa09tTnZibVpzZFdWdVkyVTZZekJpWVRVMU16Z3RObUk1TkMwME4yUTVMVGxqWW1NdE1USXhZV1kyTlRsak1EVXpPbU52Ym5SbGJuUXZNalU1TkRJME16Y3dmREl3TWpBdE1EZ3RNRE5VTURZNk1qRTZNRFl1T1RJd1dueFdTVVZYUlVRPQ==",
"timestamp": "2020-08-03T06:21:06.920Z",
"eventType": "VIEWED",
"object": {
"id": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6YzBiYTU1MzgtNmI5NC00N2Q5LTljYmMtMTIxYWY2NTljMDUzOmNvbnRlbnQvMjU5NDI0Mzcw",
"localResourceId": "259424370",
"name": "Example 1 Home",
"type": "PAGE",
"product": "CONFLUENCE",
"cloudID": "af76d8a4-c794-498c-9731-c2148879c4bf",
"url": "https://example.atlassian.net/wiki/spaces/E1/overview",
"iconURL": "https://home-static.us-east-1.prod.public.atl-paas.net/confluence-page-icon.svg"
},
"containers": [
{
"id": "YzBiYTU1MzgtNmI5NC00N2Q5LTljYmMtMTIxYWY2NTljMDUz",
"localResourceId": "af76d8a4-c794-498c-9731-c2148879c4bf",
"type": "SITE",
"product": "CONFLUENCE",
"cloudID": "af76d8a4-c794-498c-9731-c2148879c4bf",
"url": "https://example.atlassian.net/wiki"
},
{
"id": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6YzBiYTU1MzgtNmI5NC00N2Q5LTljYmMtMTIxYWY2NTljMDUzOnNwYWNlLzc2MzEyZjYzMzA2MjYxMzUzNTMzMzgyZDM2NjIzOTM0MmQzNDM3NjQzOTJkMzk2MzYyNjMyZDMxMzIzMTYxNjYzNjM1Mzk2MzMwMzUzMzJmNDUzMQ==",
"localResourceId": "76312f63306261353533382d366239342d343764392d396362632d3132316166363539633035332f4531",
"name": "Example 1",
"type": "SPACE",
"product": "CONFLUENCE",
"cloudID": "af76d8a4-c794-498c-9731-c2148879c4bf",
"url": "https://example.atlassian.net/wiki/spaces/E1",
"iconURL": "https://example.atlassian.net/wiki/images/logo/default-space-logo-256.png"
}
],
"contributors": [
{
"profile": {
"accountId": "123057:5cb5312f-1136-422f-92f7-b077349b5xyz"
},
"lastAccessedDate": "2020-08-03T06:20:30.749Z",
"count": 1
}
]
}
}
Rate this page: