Error with calling plugin in scriptrunner

Aira Veronica Dizon February 5, 2020

Why am I getting this error?

-------------------------------------------------------------------------------------------------

General error during conversion: Requested plugin com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager was not installed/enabled-

--------------------------------------------------------------------------------------------------

Below is a snippet of my script in calling the plugin:

import com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManage


@WithPlugin("com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager")

@PluginModule

TGEGridTableDataManager tgeGridDataManager

 

tgeGridDataManager = ComponentAccessor.getOSGiComponentInstanceOfType(TGEGridTableDataManager.class);
def rows = tgeGridDataManager.readGridData(issue.getId(), tgeCustomFieldId, null, null, 0, 100, user);

 

 

What should I do to call the TGE plugin in my script?

1 answer

0 votes
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 5, 2020

Hi,

Could you try to replace this line?

@WithPlugin("com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager")

and use this line instead:

@WithPlugin("com.idalko.jira.plugins.igrid")


Don't hesitate to share with us the results,
Regards

Marc Minten _EVS_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 5, 2020

or use

PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor()
Class dataManagerClass = pluginAccessor.getClassLoader().findClass("com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager")
def tgeGridDataManager = ComponentAccessor.getOSGiComponentInstanceOfType(dataManagerClass);
Aira Veronica Dizon February 9, 2020

Hello,

According to ScriptRunner, they have updated their way of calling plugin resources by using @WithPlugin and @PluginModule.

I have used what you suggested:

PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor()
Class dataManagerClass = pluginAccessor.getClassLoader().findClass("com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager")
def tgeGridDataManager = ComponentAccessor.getOSGiComponentInstanceOfType(dataManagerClass);

but I am  getting errors with this.

and when I used:

@WithPlugin("com.idalko.jira.plugins.igrid")

there are no more errors. However, my script is still returning an empty grid data, I think the plugin is still not being recognized :( 

Aira Veronica Dizon February 9, 2020

Will my script still work correctly even if it has static type checking errors?

Because I returned my script to its original script using this: https://docs.idalko.com/tgng/pages/viewpage.action?pageId=26183994

i just edited the value of the custom field and the values in the checking of row values. I get static type checking errors, but it is still allowing me to run the script. And then I tried testing it, however I'm getting this error:

"It seems that you have tried to perform an illegal workflow operation.

If you think this message is wrong, please contact your JIRA administrators."

 

What do you think is the problem why my script is not working? :(

Thank you!

Aira Veronica Dizon February 9, 2020

I'm sure that I put the correct values in  the script, but I still get static type checking errors and my scriptrunner validator is still not working :(

Suggest an answer

Log in or Sign up to answer