Rate this page:
You can configure a scheduled trigger for your existing app to repeatedly invoke a function on a scheduled interval.
This guide assumes you have an app with a function that you would like to trigger on a schedule. If you haven’t already created a function, see Getting started for step-by-step instructions on setting up Forge and creating your first app.
To develop your function, create a temporary web trigger to invoke your function manually while testing. Add a web trigger to your as follows:
modules: webtrigger: - key: temporary-development-webtrigger function: '<your-function-key>'
You'll need to redeploy your app to add the web trigger module. If this is the first time you're deploying your app, you'll also need to install the app on an Atlassian site.
Navigate to the app's top-level directory and deploy your app by running:
Install your app by running:
Select your Atlassian product using the arrow keys and press the enter key.
Note, running the command only installs your app onto the selected product. To install onto multiple products, repeat these steps again, selecting another product each time. Note that the Atlassian Marketplace does not support cross-product apps yet.
Once the successful installation message appears, your app is installed and ready to use on the specified site. You can always delete your app from the site by running the command.
Iterate through your function’s development by invoking the function using the web trigger.
Note that the parameter does not have a value for scheduled triggers, so you should avoid referencing it in your function.
Note, is only available in the environment. See the environment restrictions on the environments and versions page for details.
Once you have completed development of the function, you can add a scheduled trigger to your :
modules: scheduledTrigger: - key: my-scheduled-trigger function: '<your-function-key>' interval: hour
While debugging, you can keep using the web trigger and scheduled trigger. When you’re done, you can remove the web trigger module from the manifest file.
To make your changes permanent, redeploy your app using the command.
Rate this page: