Class iqlFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass(“com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade”);
def iqlFacade = ComponentAccessor.getOSGiComponentInstanceOfType(iqlFacadeClass)
// Configuration
def selectListValue = replica.customFields.“SelectList”?.value?.value
if (selectListValue) {
// Construct IQL query to find the asset by the select list value
def selectList = selectListValue.toString().replaceAll(“\[|\]”, “”)
def iqlQuery = “objectType = "objectID" AND Name = "$selectList"”
def objects = iqlFacade.findObjects(iqlQuery)
throw new com.exalate.api.exception.IssueTrackerException(objects.toString())
if (objects) {
def objectBean = objects[0] // Assume first match
issue.customFields."Assets".value = objects[0]
}
}
The results of “def objects = iqlFacade.findObjects(iqlQuery)” returns empty value on Exalate. So I am not able to map the values to the asset custom field. The user executing the the script has admin permission on Jira.
Troubleshooting:
Query outputs results through Asset Search,.
Executed the same script on Scriptrunner console and it returned values. Exalate is failing to fetch the values for the query.
Can someone help with fixing the script?