Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

error when extracting information from a grid to a script field

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");
}

1 answer

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

⚡️NEW Group for Confluence Cloud Admins

Calling all Confluence Cloud Admins!  We created a new Community Group to support your unique needs as Confluence admins. This is a group where you can ask questions, access resou...

105 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you