Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

What Insight riada import am I missing?

Eric Dierkens
Contributor
January 17, 2018

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.

 

import com.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]); return true;

 

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Champion
October 28, 2020

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

Matt Noe
Contributor
October 28, 2020

@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.

Kristian Walker _Adaptavist_
Community Champion
October 28, 2020

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

Like Matt Noe likes this
TAGS
AUG Leaders

Atlassian Community Events