Can this be adapted to be a form instead

Hi everyone,
A few little app ideas I have, just things for the teams to use internally all require some config information to be stored first run. (A token or some Assets attribute ID), then when the app runs after that it would use the stored config.

The only config information I can see is in this tutorial about a confluence macro
https://developer.atlassian.com/platform/forge/add-configuration-to-a-macro/

I have a form in JSM which captures the config information but currently then just uses that on the next form when a process is run.

What I want to do is capture the info from the first form (all the config info) and then the submit process of the second form uses the config variables that are held.

Am I on the correct path attempting to flip that to hold previous info stored on a form.

Has anyone seen a working example in code that leverages a form to capture and store config info?

Many thanks

Based on your description I would call your scenario “Add-on requires configuration to run”. I couldn’t find a good example of something like that outside of a Confluence Macro which has a built-in approach to this that is different from what you need.

The way you are approaching it seems fine but a more common pattern is to have a settings page where your add-on is configured. If someone attempts to use the add-on without it being configured, it would display a warning or an error with a link to the configuration page.

You can use a Jira global page or maybe even Project settings page module for your configuration form. Then, you can use Forge storage to store your configuration variables from your configuration form and then read them back later in your add-on’s main form. Hopefully that points you in the right direction.

1 Like

Thanks for the info.
Currently the config form then when that is ‘saved’ the main form is shown all happen on the QueuePage as I selected that for JSM when I created the project.

Need to figure out how to split them out, but the main challenge is storing the values from the config and then using them when the submit is pressed on the main form so I’ll churn through your links and see where I get tangled :smiley: