Hi,
I'm trying to execute the following script in order to update insight object attribute
https://documentation.mindville.com/display/ICV60/Update+object+attribute
However, many syntax errors were displayed.
Any idea?
Thanks
Ahmed
The errors are all static checking errors, which can be ignored. You do need to define "issue" since the code assumes that this variable will be supplied by the caller.
If you are going to use ScriptRunner, there is a better way to bring in the Insight code:
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.riadalabs.jira.plugins.insight")
Put this code near the head of your routine. You can then import the Insight libraries like any other library. Here is some code sample that I wrote
import com.atlassian.jira.component.ComponentAccessor;
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectSchemaFacade;
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectTypeFacade;
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectTypeAttributeFacade;
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade;
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade;
import com.riadalabs.jira.plugins.insight.services.model.ObjectBean;
import com.riadalabs.jira.plugins.insight.services.model.CommentBean;
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade;
import com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactory;
//import insight.Insight
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.riadalabs.jira.plugins.insight");
ObjectFacade of = ComponentAccessor.getOSGiComponentInstanceOfType(ObjectFacade);
ObjectSchemaFacade osf = ComponentAccessor.getOSGiComponentInstanceOfType(ObjectSchemaFacade);
ObjectTypeFacade otf = ComponentAccessor.getOSGiComponentInstanceOfType(ObjectTypeFacade);
ObjectTypeAttributeFacade otaf = ComponentAccessor.getOSGiComponentInstanceOfType(ObjectTypeAttributeFacade);
This approach has the advantage that you can eliminate the static type checking errors because you can tell groovy the type of object that you are instantiating.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you executing this in the Insight Script Console? Can you provide the syntax errors that you see?
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.
You have just to copy paste the script in scriptrunner's script console. Errors are related to insight classes
Regards,
Ahmed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are differences between Insight's script console and ScriptRunner's console. They don't use the same groovy class and they set up the script environment slightly differently. In fact, there appears to be (or have been) a difference between the script console and the automation script runner. This has bitten me in the past.
You may be right and the code will work in ScriptRunner, but I would expect Mindville's code to have been written and tested in their environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea how to resolve these issues? Neither Mindville support nor adaptavist can take a look on it, considered as out of scope :(
Thanks
Ahmed
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.