jira:projectSettingsPage module example code

Hi,

I would like to create Project settings Page for my Jira Plugin (jira:projectSettingsPage module).
Is there an example code how to do this?
I am mostly interested in how (or where) do I store the setting value (in my case just one enum for now, but in the future it can be text or numerical value), and how do I get this value later in the plugin code.
I am currently using UI Kit (for now)

Maybe have a look at the Issue Health example app https://developer.atlassian.com/platform/forge/example-apps-jira/#issue-health-app. And Forge storage API here https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/.

See also here Forge App development sample with storage API

2 Likes

Thank you very much!

I’m struggling to understand the scope of the storage API. I have a plugin, that can be installed on different Jira projects, that can again belong to different Sites.

If I store something in the Storage, is the value stored unique for the project, site or the whole plugin (across all projects and sites)?

It says here:
https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/
ā€˜Data stored using the Storage API isn’t shared between Forge apps on the same site or across different Atlassian sites.’
That is reffereing to ā€˜different Forge apps’ but what about same app. If I have same app installed on two projects or sites, is the storage shared?

Obviously, since I am implementing ā€˜projectSettingsPage’ I would like to have project specific settings, so storage should not be shared. Do I need to us project specific key for this?

You plugin will be installed for a Jira instance (site), not per project. Then when the projectSettingsPage is called, you get the project key as a context parameter. I guess you should use project key as key in set and get from storage API. Then you store a project specific information to the storage API.

1 Like

Hi @axldpir,

Regarding your question on the scope of Forge storage, your app has a separate region of storage for each tenant in order to ensure tenants are isolated from one another. This means you can use project IDs as storage keys knowing they will be unique within a given tenant storage area.

ā€˜Data stored using the Storage API isn’t shared between Forge apps on the same site or across different Atlassian sites.’
That is reffereing to ā€˜different Forge apps’ but what about same app. If I have same app installed on two projects or sites, is the storage shared?

This is referring to the same app. Or another way of putting this is each {tenant, app} combination gets a separate Forge storage area.

And just to be extra clear, in addition to the tenant isolation I pointed out above, this scheme also keeps storage isolated between apps.

I hope this clarifies this for you.

Regards,
Dugald

4 Likes

Thank you both for a helpful information.
Just to clarify the terminology, because there are few floating around. I assume that tenant = Organisation = site = instance.

@axldpir,

Since we’re clarifying, the developer community will agree with 3 out of 4 of your equivalencies: tenant = site = instance. I think Atlassian prefers the term site.

However, ā€œorganizationā€ is a special concept; a ā€œsuper tenantā€ if you will. For most small customers, there is a 1:1 between their organization and their site. But for our largest, enterprise customers the organization is a thing that aggregates multiple sites. Sites have content like issues in projects, and pages in spaces. Organizations have the shared set of people and groups that are used to control access across all the content.

You didn’t use the term ā€œorganizationā€ in this thread so there’s no misunderstanding here. But it’s an easy term to miss around Atlassian because it doesn’t quite mean what many people think it means (ie your original assertion that org = site).

2 Likes

Thanks for clarification!
In the meantime I have implemented project settings with Storage API and it works perfectly.

2 Likes