Hi there! I am using the "TableGridNextGen" plugin. I want to extract in a script field the data entered in a grid in an issue "X" but I am getting the following error:
Grid ID=11406 data cannot be retrieved: No signature of method: com.idalko.tgng.jira.server.api.GridServiceImpl.readGridData() is applicable for argument types: (java.lang.Long, java.lang.Long, com.atlassian.jira.user.BridgedDirectoryUser, null) values: [202902, 11406, iflores:1, null]
I leave you my complete code:
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.security.JiraAuthenticationContext
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.plugin.PluginAccessor
import org.apache.log4j.Logger
// set up logger
Logger log = Logger.getLogger("com.idalko.scripts");
// configuration (update it to match your JIRA settings)
String tgeCustomFieldName = "Pipeline";
String columnNameToSum = "Consultor_Pipe";
// find TGE custom field
CustomFieldManager customFieldManager = ComponentAccessor.getOSGiComponentInstanceOfType(CustomFieldManager.class);
CustomField tgeCustomField = customFieldManager.getCustomFieldObjectByName(tgeCustomFieldName);
Long tgeCustomFieldIdLong = tgeCustomField.getIdAsLong();
// get current user
JiraAuthenticationContext jiraAuthenticationContext = ComponentAccessor.getOSGiComponentInstanceOfType(JiraAuthenticationContext.class);
Object userObject = jiraAuthenticationContext.getLoggedInUser();
User user = userObject instanceof ApplicationUser ? ((ApplicationUser) userObject).getDirectoryUser() : (User) userObject
// read the grid data
PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor();
Class dataManagerClass = pluginAccessor.getClassLoader().findClass("com.idalko.tgng.jira.server.api.GridService");
//def gridService = ComponentAccessor.getOSGiComponentInstanceOfType(apiServiceClass);
def tgeGridDataManager = ComponentAccessor.getOSGiComponentInstanceOfType(dataManagerClass);
Set<String> columnNames = new HashSet<String>();
log.warn(tgeGridDataManager)
columnNames.add(columnNameToSum);
Long issueId = issue.getId()
List<Map<String, Object>> gridData = new ArrayList<Map<String, Object>>();
try {
def callResult = tgeGridDataManager.readGridData(issueId, tgeCustomFieldIdLong, user, null);
gridData = callResult.getRows();
log.warn("Grid ID=" + tgeCustomFieldIdLong + " content: " + gridData + "\n");
for (row in gridData) {
def columns = row.getColumns()
// METODO PARA IMRPMIR TODO LO QUE ENCUENTRA EN LA GRILLA SIRVE PARA REVISAR EN LOG
def Consultor = columns.get("Consultor_Pipe")
log.warn("Online: "+Consultor)
}
} catch (Exception e) {
log.warn("Grid ID=" + tgeCustomFieldIdLong + " data cannot be retrieved: " + e.getMessage() + "\n");
}
Hello Ignacio,
My name is Anastasiia from iDalko Support team.
This issue is handled as part of the support at the moment.
I will revert back once that the problem is resolved proving the solution!
Anastasiia
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.