Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What Insight riada import am I missing?

Edited

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

If i'm not mistaken, you are missing the @withPlugin tag.

Check our documentation about it here: 

https://scriptrunner.adaptavist.com/4.3.5/jira/scripting-other-plugins.html

Did this help? If so, could you accept my answer so that other users know that this question has been solved?

Cheers!

DYelamos

I just tried and I get this error

"Unable to resolve class WithPlugin, unable to find class with annotation"

We have Riada Insight installed and it is working great.

The good news is that I have switched to using the Insight Script Console and it works for this.

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.mail.server.MailServerManager;
import com.atlassian.mail.server.SMTPMailServer;
import com.atlassian.jira.mail.Email;
import com.atlassian.mail.queue.SingleMailQueueItem;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.event.type.EventDispatchOption;
import org.joda.time.DateTime;
import java.util.Locale;
@WithPlugin("com.riadalabs.jira.plugins.insight")

 

You are missing the import for the annotation sir:

Add this import:

import com.onresolve.scriptrunner.runner.customisers.WithPlugin

And check again, I'm confident this will work!

Cheers!

Dyelamos

This import works within ScriptRunner

import com.onresolve.scriptrunner.runner.customisers.WithPlugin

 

but this one does not

import com.riadalabs.jira.plugins.insight.services.model.ObjectBean

Hi Eric,

I'm digging this thread because we're having the same problem with importing

com.riadalabs.jira.plugins.insight.services.model.ObjectBean class.

Did you find a solution in the end?

Cheers

Florent

We had so many wierd errors and it was so hit-and-miss and because there is no common interactive IDE design environment, like Visual Studio, for writing and debugging code we switched all of our code over to C# and now use the REST APIs.

 

One of the issues was that each thrid party vendor has their own script editor and we are not confortable replying on third party add-ons from so many sources.

Like Florent Michelis likes this

Thank you very much for your answer Eric. Sad that you did not stick with Scriptrunner.

Cheers,

Florent

ScriptRunner is a good product in itself, but to me if writing code is such an intergral part of an application/software suite, then maybe it should be part of the core software to supply a built in editor OR integrate with something like Visual Studio that can be used regardless of language choice. Not being able to debug or step through code is a non-starter for me.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

555 views 15 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you