Forge Developer

Beta

Forge Developer

Beta

Rate this page:

Product events

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 name

Event names follow the format: avi:activity:<eventType>:<objectType>.

  • eventType: The type of event that occurred. For example, assigned, viewed, or liked.
  • objectType: The type of object the event occurred to. For example, project, issue, or page.

Event format

The table below describes the fields contained in an event.

FieldTypeDescription
accountIdstringUser ID.
activityItem.eventTypeenumEvent type.
activityItem.objectActivityObjectObject (issue, page and alike).
activityItem.object.idstringObject ID.
activityItem.object.namestringObject name.
activityItem.object.typeenumObject type.
activityItem.object.productenumObject product.
activityItem.object.url and activityItem.object.iconUrlstringObject URLs (url, restUrl, iconUrl).
activityItem.containersArray<ActivityObject>A list of containers associated with the object.
activityItem.contributorsArray<ActivityContributor>List of contributors.

Examples

Below you can see examples from both Jira and Confluence product events.

Jira events

Forge apps can subscribe to these Jira events.

Event nameDescription
avi:activity:created:issueAn issue was created.
avi:activity:updated:issueAn issue was updated.
avi:activity:viewed:issueAn issue was viewed.
avi:activity:assigned:issueAn issue was assigned.
avi:activity:unassigned:issueAn issue was unassigned.
avi:activity:transitioned:issueAn issue’s status was transitioned.

Jira event example

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"
}

Confluence events

Forge apps can subscribe to these Confluence events.

Event nameDescription
avi:activity:published:pageA page was published.
avi:activity:published:blogpostA blogpost was published.
avi:activity:viewed:pageA page was viewed.
avi:activity:viewed:blogpostA blogpost was viewed.
avi:activity:liked:pageA page was liked.
avi:activity:liked:blogpostA blogpost was liked.
avi:activity:commented:pageA page was commented on.
avi:activity:commented:blogpostA blogpost was commented on.

Confluence event example

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: