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;
Hi Matt,
Thank you for your question.
I can confirm that checkbox fields use a List data structure which means you must get all values and check if they match the value you want to have as the selected value in order to test this in a workflow post function condition.
I can confirm I have created an example of how to do this here which you can use as a reference guide to help create the condition which you require.
I hope this information helps.
Regards,
Kristian
@Kristian Walker _Adaptavist_ Thank you for the information. I placed this suggested correction in my post function and now I am getting an error: [Static Type Checking] - No such property: Value for class: java.lang.object @ line 1, Column 51
I'm new to Groovy - do I need to import a different library for this to work? This is for JIRA cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matt,
This is just a static type checking warning where the compiler does not understand the code as described here and will not stop the code from working.
This means you should be able to save and run the code and it will work as expected.
Regards,
Kristian
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.