We have 100's of structure boards and many of them have synchronizers installed. We have built two custom synchronizers and are interested in determining which structure boards are using them. I'm happy to write a script or DB query but can't figure out which API to exploit. I've looked through your REST endpoints to no avail and recall you saying that your derby DB isn't query-able. Am I out of luck?
Thanks!
Hello Thomas, thanks for the question! You can get the result by using Structure's Java API. You'll need to install the Script Runner plugin (if you don't have it yet) and use a Groovy script like the following:
// get the services we need import com.atlassian.jira.component.ComponentAccessor def plugin = ComponentAccessor.getPluginAccessor().getPlugin('com.almworks.jira.structure') def structureManager = plugin.getModuleDescriptor('structure-manager').getModule() def syncManager = plugin.getModuleDescriptor('sync-manager').getModule() // get all structures (except archived) def structures = structureManager.getAllStructures(null, null, true) // find structures having the synchronizers you need def result = structures.findAll { str -> // get all synchronizers for the structure def syncs = syncManager.getInstalledSynchronizersForStructure(str.id) // check if any of the syncs satisfies the condition syncs.any { sync -> // in this case, the sync must be enabled and be a FilterSynchronizer // adjust the condition as needed syncManager.isAutosyncEnabled(sync.instanceId) && sync.synchronizer.class.simpleName == 'FilterSynchronizer' } } // format the result -- you may need to use <br> as separator for ScriptRunner 3 result.join('\n')
This example script finds all enabled filter synchronzers, so you'll need to adjust the it to find the ones you're interested in.
We also have an online developer guide with a Java API reference, which could be helpful.
I hope this helps. Please write if you have any questions.
Worked like a champ! Thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.