The trigger module invokes a function or calls a remote backend when an
Atlassian app event,
Forge app event,
Forge app lifecycle event,
or data security policy event
is fired.
| Property | Type | Required | Description |
|---|---|---|---|
key |
| Yes |
A key for the module, which other modules can refer to. Must be unique within the manifest. Regex: |
function | string | Required if using triggers. | A reference to the function module that defines the module. |
endpoint | string | A reference to the Required if no | |
events | Array<string> | Yes | A list of Atlassian app events that trigger the function or endpoint. |
filter | Filter | No | A set of options to prevent invoking a function or endpoint. |
| Property | Type | Required | Description |
|---|---|---|---|
ignoreSelf | boolean | The filter property must have either ignoreSelf or expression or both of them defined. |
Ignore self-generated events. For example, an app updates an issue and ignores the Note that currently |
expression | string |
An expression used to filter out unwanted events. For example, instead of listening to all | |
onError | enum | No |
Specify what should happen when an error occurs while evaluating the expression. You can either invoke a function or call a remote backend and publish app logs. Can be used only with the The possible values are:
|
When your trigger function is invoked, it receives two arguments:
1 2export async function myTriggerFunction(event, context) { // Handle the event }
The context object contains information about the environment and installation where the trigger was invoked:
| Property | Type | Description |
|---|---|---|
principal | Principal | undefined | The principal containing the Atlassian ID of the user that interacted with the component. |
installContext | string | The ARI identifying the cloud or Atlassian app context of this component installation. |
workspaceId | string | undefined | The ID of the workspace on which the extension is working. |
license | License | undefined | Contains information about the license of the app. This field is only present for paid apps in the production environment. license is undefined for free apps, apps in DEVELOPMENT and STAGING environments, and apps that are not listed on the Atlassian Marketplace. |
installation | Installation | undefined | A summary of the app installation, including the installation ARI and the contexts where the app is installed. |
For complete context schema details and TypeScript definitions, see Function Arguments.
1 2modules: trigger: - key: issue-updated-trigger-with-ignore-self-and-expression function: main events: - avi:jira:updated:issue filter: ignoreSelf: true expression: event.issue.fields?.issueType.name == 'Bug' onError: RECEIVE_AND_LOG function: - key: main handler: index.run
Rate this page: