If I type this in to the ScriptRunner Console, it does not recognize iqlFacade.findObjectsByIQLAndSchema. I get a message the says it can't find the matching method. This happens with any objectFacade call such as objectFacade.loadObjectBean("object key here") ie TSD-18.
importcom.atlassian.jira.component.ComponentAccessor;
/* Get Insight IQL Facade from plugin accessor */Class iqlFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade");def iqlFacade = ComponentAccessor.getOSGiComponentInstanceOfType(iqlFacadeClass);/* Specify the schema id as well as the IQL that will fetch objects. In this case all objects with Name matching the valueCF, be sure to include " around value */def objects = iqlFacade.findObjectsByIQLAndSchema(1,"\"The attribute\" = \""+ attribute value +"\"");// See the complete list of possible IQL on the Insight Query Language documentation page/* If this is a mandatory field you should be able to do this: */log.info("Insight object: "+ objects[0]);returntrue;
I think it's because there is no "page" object in that context.
When I create a panel in that same context
writer.write("""<div style="padding: 5px 5px 5px 0;">Test Panel: ${context.keySet()}</div>""")I see just "Dashboard Test Panel: [action]"
So the only object inside the atl.page.metadata.banner is the "action" object
Byt outputing context.action.getClass() I was able to find my way to
Where I found that we can get the current page.
writer.write("""<div style="padding: 5px 5px 5px 0;">Test Panel: ${context.page.id}</div>""")This returned the page id.
So I think if you just change
def page = context.page as Page
to
def page = context.action.page as Page
It might work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.