Help with creating a Confluence Gadget



I can find a good amount of information in regards to creating a gadget on JIRA and of course I know I can link that to Confluence using the XML link. However, I noticed in the Atlassian SDK, there is a feature to create a Confluence Gadget. Upon doing so, I was able to successfully create and install a Confluence Gadget into Confluence - however, I seem to be having difficulties including AJS and other dependencies.

If I try to include anything other than: #requireResource(“com.atlassian.jira.gadgets:common”)

I’ll get an error resembling: “Error rendering macro ‘gadget’ : The gadget at rest/gadgets/1.0/g/{atlassian-key}:{resource-key}/gadgets/jira-issue-status-public-viewer/gadget.xml was not added to this Confluence instance yet.” where the gadget should be. In addition, This error showing that I tried to include resources from my web-resources in atlassian-plugin.xml. This will occur for any other resource than the com.atlassian.jira.gadgets:common. I have removed this line and tried with no luck. In fact, I’ve tried many different combinations, but have had no success.

Also, can anyone shed light on how to resize the gadget? I see documentation for this in JIRA -> gadgets.window.adjustHeight() but that requires me to create the gadgets variable using AJS which I cannot seem to get to work in Confluence. Perhaps, I am missing the correct step to creating a gadget variable in the xml.

Ideally, I’m just trying to create a shell gadget for confluence which I can package with what I want but I’d like to be able to customize the size and look to match with Atlassian.

Any help would be greatly appreciated!