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

315 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

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