Create Plugin Settings(UI)

Hello there.

I’ve been stuck writing a Macro and trying to set up global resources for it.
I basically want to store resources(Sets of Data) and then access it from my plugin.
I have been through the Admin Configuration Form Tutorial and some other Atlassian resources.

I don’t seem to be able to connect the snippets.
Can anyone give me pointers as to how I can go about this?

Thanks
Maja

I’m having the same problem too.
have you figure out the problem?

I went through the tutorial as well. While the form displays nicely, the settings are neither saved or retrieved. Attempts at debugging had the following results:

  1. Querying using the REST API browser shows that the data was not saved, and using the PUT call does not do anything either.

  2. Using browser console debug does not appear to show javascript file had been downloaded or was perhaps embedded - I am no expert in javascripting or how Atlassian loads the js files

  3. Using console.log() methods does not show any execution of the js

  4. There appears an exception that keeps occuring when loading the file, the same as detailed in https://ecosystem.atlassian.net/browse/UPM-5373

Really wondering how the developer of the tutorial got the plugin working?
What is missing here?
(there were other tutorials in the past, that there were expected files or configuration that was missed in the documentation of the tutorial. The code from repo, https://bitbucket.org/serverecosystem/xproduct-admin-ui-plugin, does not work either)

Made it work by making the following changes to the tutorial, https://developer.atlassian.com/docs/common-coding-tasks/creating-an-admin-configuration-form.

For the file, admin.vm, change the line

$webResourceManager.requireResource("com.atlassian.plugins.tutorial.xproduct-admin-ui-plugin:resources")

to

$webResourceManager.requireResource("com.atlassian.plugins.tutorial.xproduct-admin-ui-plugin:xproduct-admin-ui-plugin-resources")

This link the resources in atlassian-plugin.xml that was define with key “xproduct-admin-ui-plugin-resources”

Then, in order to ensure the i18n properties are discovered, move the i18n entry into the element, like the following:

    <!-- add our i18n resource -->
    <resource type="i18n" name="i18n" location="xproduct-admin-ui-plugin"/>
    
    <!-- add our web resources -->
    <web-resource key="xproduct-admin-ui-plugin-resources" name="xproduct-admin-ui-plugin Web Resources">
        <dependency>com.atlassian.auiplugin:ajs</dependency>

to

    <!-- add our web resources -->
    <web-resource key="xproduct-admin-ui-plugin-resources" name="xproduct-admin-ui-plugin Web Resources">
        <dependency>com.atlassian.auiplugin:ajs</dependency>
        
        <!-- add our i18n resource -->
        <resource type="i18n" name="i18n" location="xproduct-admin-ui-plugin"/>

Now, the javascript used in the tutorial will linkup with the admin.vm form.

(Previously, I had accidentally force set the values into the settings while performing some settings. I have reverted it and the values were reflective of the data set, either through REST browser or form)