how to get all the data from table grid editor by using java API or jira rest api Edited

see i have tryed this but whenever i print this i get total object are available instead of get all the values available in grid table...

Long l = Long.valueOf(10001);
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField customField = customFieldManager.getCustomFieldObject(l);
Object value = issues.get(0).getCustomFieldValue(customField);
// there is two column entry in my table grid editor so getting value =2
System.out.println("custom field TGE value::::::::::"+value);
//buti want the actual value available in grid table. I am getting other custom field value but in case of grid table i getting only total column count
 

 

1 answer

Table Grid customfield stores its data in separate db table which you've defined in your configurations. And API that you used is getting values from jira db table "customfieldvalue". Therefore to get values from TGE field you should use its own API. Here is a nice example of script that might cover your needs:

https://wiki.idalko.com/display/TGPD/Read+Grid+Data

about TGE.. information is very helpfull and the link (https://wiki.idalko.com/display/TGPD/Read+Grid+Data) you have mention i have tried that in script runner it is working great. Now i am thinking  to get TGE value using JIRA REST API and i have done it my using REST Plugin Module (https://developer.atlassian.com/docs/atlassian-platform-common-components/rest-api-development/rest-plugin-module) now the problem is when it ask for Enter REST Path /restservice: : while selecting plugin module which is no.14 so i have entered complate jira rest api url formate with grid_id and issue_id and i am getting TGE value in json format but it's fixed in:

<rest name="Rest Service" i18n-name-key="rest-service.name" key="rest-service" path="/http://localhost:2990/jira/rest/idalko-igrid/1.0/grid/10001/issue/10000" version="1.0">

  <description key="rest-service.description">The Rest Service Plugin</description>
</rest>
how can i pass grid and issue id (grid/10001/issue/10000) dynamically in "path".
Any suggestion or link would be great help..
thanks in advance

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,089 views 13 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot