When attempting to use scriptrunner scriptfield to read a Table Grid next gen field, we get the following error:
com.idalko.tgng.jira.server.api.GridException: evalBuildGrid: Error evaluating Javascript: No language and polyglot implementation was found on the classpath. Make sure the truffle-api.jar is on the classpath.!
at com.idalko.tgng.jira.server.api.GridServiceImpl$.com$idalko$tgng$jira$server$api$GridServiceImpl$$handleErrors(GridServiceImpl.scala:116)
at com.idalko.tgng.jira.server.api.GridServiceImpl.readFieldData(GridServiceImpl.scala:38)
at com.idalko.tgng.jira.server.api.GridService$readFieldData.call(Unknown Source)
at Script112.run(Script112.groovy:32)
Script looks like this...
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.plugin.PluginAccessor
import com.atlassian.jira.user.ApplicationUser
import org.apache.log4j.Category
def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction")
log.setLevel(org.apache.log4j.Level.DEBUG)
log.debug "debug statements"
def issueManager = ComponentAccessor.getIssueManager();
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def issuetype = issue.getIssueType().name
def issueId = issue.getId()
// Set "Budget Estimate" field id
Long tgngCustomFieldId = 21000
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
// Get GridService - Ignore error messages for the plugin and service
PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor()
Class apiServiceClass = pluginAccessor.getClassLoader().findClass("com.idalko.tgng.jira.server.api.GridService")
def gridService = ComponentAccessor.getOSGiComponentInstanceOfType(apiServiceClass)
// Read field data
def fieldData = gridService.readFieldData(issueId, tgngCustomFieldId, user, null)
def gridRows = fieldData.getRows()
StringBuilder result = new StringBuilder()
for (row in gridRows) {
def columns = row.getColumns()
result.append("${columns.get("Platform")};")
result.append("${columns.get("Type")};;")
result.append("${columns.get("Jan")};")
result.append("${columns.get("Feb")};")
result.append("${columns.get("Mar")};")
result.append("${columns.get("Apr")};")
result.append("${columns.get("May")};")
result.append("${columns.get("Jun")};")
result.append("${columns.get("Jul")};")
result.append("${columns.get("Aug")};")
result.append("${columns.get("Sep")};")
result.append("${columns.get("Oct")};")
result.append("${columns.get("Nov")};")
result.append("${columns.get("Dec")};")
result.append("${columns.get("EstComplete")};,")
}
return result
Dear @Erwin Oliva ,
Have you found a solution to this error?
We have the same.
Thank you and Kind regards,
Polina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've created a ticket to the vendor describing this issue and got updates :
"It seems like the issue you are facing is related to a known bug. A corresponding internal ticket was created and forwarded to the development team for analysis and resolution.
I am attaching this ticket to the internal bug ticket so that you are notified as soon as new information is available or the fix is released as a part of a new version!
As a workaround we can provide you with a custom build that includes the fix for your issue, however, could you please let me know what version of Jira you use?"
:)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can create yours to speed them up here :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your suggestion Polina. I also raised the issue with Idalko.
Cheers, Erwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since the last Table Grid Addon version update our script is now failing with the following error code: We have not made any changes to the script!
Script function failed on Automation for Jira rule:
Script function failed on Automation for Jira rule: AUTOMATION RULE NAME, file: <inline script>, error: com.idalko.tgng.jira.server.api.GridException: evalBuildGrid: Error evaluating Javascript: No language and polyglot implementation was found on the classpath. Make sure the truffle-api.jar is on the classpath.!
Was your script running correctly prior to the Table Grid Update??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, my script was running previously, but in our case we upgraded to DataCenter JIRA so I am not sure if table grid was also updated. But for sure, it was running previously.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Erwin Oliva
Instead of using the:
Class apiServiceClass = pluginAccessor.getClassLoader().findClass("com.idalko.tgng.jira.server.api.GridService")
def gridService = ComponentAccessor.getOSGiComponentInstanceOfType(apiServiceClass)
Have you tried using the @WithPlugin and @PluginModulue annotations as shown in this ScriptRunner documentation?
You can refer to the sample code provided in the AdaptavistLibrary, which uses the @WithPlugin and @PluginModule annotations.
This community discussion has some examples of using @WithPlugin and @PluginModule for the Idalko plugin.
I hope this helps to answer your question. :-)
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ram Kumar Aravindakshan _Adaptavist_
Do I only use one or both? Do I also need to add an import statement?
I am getting this error
General error during conversion: Requested plugin com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager was not installed/enabled, compiling source unit Script42.groovy.
when I try to add the following:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Erwin Oliva
To answer your question, yes you will need to use both.
Also, when using the @WithPlugin annotation, you will only need to specify the package name. The absolute class name is not required.
For example:
@WithPlugin("com.idalko.plugins.igrid.api.data")
@PluginModule
TGEGridTableDataManager tgeGridDataManager
I hope this helps to answer your question. :-)
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Erwin Oliva
Is your question answered?
If yes kindly accept the solution provided.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ram Kumar Aravindakshan _Adaptavist_ ,
Unfortunately it didn't work for me. I have to open a support ticket with the Table Grid vendor and am waiting for its resolution still.
Regards,
Erwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It appears that Idalko (vendor) wants us to upgrade to the latest version. We are on 1.13.7, and latest version is 1.13.8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Erwin Oliva
Thanks for the update.
It would be best to upgrade your plugin(s) to the latest release to ensure that you have all the new features and bug fixes.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the same problem, and succesfully solved with the followings:
final Long tableGridCustomFieldId = 11107
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.idalko.tgng.jira.server.api.GridService
@WithPlugin('tge.cloud')
@PluginModule
GridService gridService
...
def fieldData = gridService.readFieldData(issue.getId(), tableGridCustomFieldId, user, null)
def rows = fieldData.getRows()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.