Rate this page:

Events

Events can be used to invoke your Forge app without an UI interaction, for example:

  • Jira and Confluence events are generated by user activity in the products. Your app can subscribe to one or more events via the manifest.yml file.
  • Web trigger events are incoming HTTP requests. You can supply these web trigger URLs to invoke your app from a third-party app.

You can also use scheduled triggers to invoke your app on a periodic basis.

Product events

Product events are generated when users perform actions in Atlassian products. Apps 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;
}

To receive a product event with a Forge app, your Jira projects or Confluence spaces must be accessible by the default user group. This is because the system user created for your Forge app is only a member of the default user group. If a restricted Jira project or Confluence space generates a product event, your Forge app is unable to receive the event.

To learn more about this issue and for updates on when this behavior is improved, see the FRGE-212 Jira issue.

OAuth 2 scopes

When using product events, your Forge app must have permission from the site admin to access the data it provides within the event payload. The OAuth scope required is documented under each product event. Note, running the forge lint command picks up these required scopes.

See Permissions for detailed information about each scope. See Add scopes to call an Atlassian REST API to add new scopes to your app.

Arguments

  • event: a payload detailing the event. See the documentation for an event for a detailed description of its payload.
  • context: additional information about the context the event occurred in.
    • installContext: an identifier for the Atlassian site the app is installed in.

Rate this page: