How can I add all the XML for all the jira gadgets to confluence?

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2011

It appears that before I can use a jira gadget in confluence I need to manually add the gadget XML's URL to the confluence external gadgets list? This seems manual and labourious, moreover when you add a plugin with a new gadget to jira you need to remember to add it to confluence.

Am I right in this?

If so, given that there is a trust relationship, could confluence not suck em all out from jira? Or have the gadget browser dynamically request the gadgets from the trusted apps?

EDIT: jira seems to have gadget subscriptions for entirely this purpose, but I can't find something similar in confluence 3.5.7 - is it there?

2 answers

1 accepted

1 vote
Answer accepted
Penny Wyatt (On Leave to July 2021)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 7, 2011

You're right that it should be possible to do, but sadly it looks like Confluence as a gadget subscription client (i.e. automatically sucking JIRA gadgets into Confluence) appears to still be on the Confluence backlog.

It shouldn't be too hard write a quick script to do it manually in the meantime. I apologise in advance for this hideous piece of horrible hackery - it's 2am on a Friday night after D&D, after all :-) Standard disclaimer: This isn't supported by Atlassian, test it against a test server before running it against production, not guaranteed to work against future versions (or at all).

1) Grab this code from Pastie and save it as "Gadgets.groovy":

http://www.pastie.org/private/2fredz425ed49cwjwrfcq

2) Read through the code and make sure I'm trustworthy.

3) Run it against your JIRA server to ensure it's finding all the gadgets:

e.g. groovy Gadgets.groovy https://jira.atlassian.com

3) Then give it your Confluence URL and sysadmin credentials and let it add them for you:

e.g. groovy Gadgets.groovy https://myjirainstance.com http://myconfluenceinstance.com/wiki sysadmin mypassword

If they already exist in the directory it doesn't duplicate them.

Error handling is sketchy but I'm sure you can take it from here.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 8, 2011

Hi Penny,

Can't believe you did that at 2am ;-) And using a URLConnection rather than http-builder or the like is hard-core!

cheers, jamie

0 votes
Jeff Kirby
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2011

For what it's worth, on July 7, 2010, I filed an Improvement request at jira.atlassian.com for this. It's https://jira.atlassian.com/browse/CONF-20295. Currently it has zero votes. The more votes, the more likely Atlassian is to make it a product feature.

Cheers

Suggest an answer

Log in or Sign up to answer