Search code examples
typescripttriggersatlassian-forgejira-forge

Atlassian Forge: Where do I find type definitions for a trigger function


When I create a new app as a product trigger, then I get a index.jsx that looks like:

export async function run(event, context) {
    console.log('Hello World!');
}

I can rename the index.jsx to tsx that the file is treated as Typescript file, but where do I find the definitions for èvent and context?


Solution

  • From the Atlassian staff I got following answer:

    we don’t have TS definitions for the event and context in code, but you can find some more detail about the payload for different product events at https://developer.atlassian.com/platform/forge/events-reference/jira

    You could also try console.log the event and context functions and use the forge logs command to see what information there is.

    You find it here: https://community.developer.atlassian.com/t/where-do-i-find-type-definitions-for-a-forge-trigger-function/51199/2