How to import the Table Grid values to eazybi

Tanu February 11, 2020

I need a way to import value of a custom field which is Table Grid type into eazyBI.

need help.

1 answer

0 votes
Roberts Čāčus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2020

Hi @Tanu ,

 

Currently, eazyBI doesn't have an integration with the iDalko Table Grid Editor custom fields. Please have a look at the full list of the Jira apps eazyBI has integration out of the box on the eazyBI documentation page - https://docs.eazybi.com/eazybijira/data-import/data-from-jira-and-apps.

There is a workaround on how to import each column as a multi-value dimension. It involves defining the import parameters in the eazyBI advanced settings, defining a JavaScript calculated custom field for each column from the table. Please read more on the eazyBI JavaScript calculated custom fields here - https://docs.eazybi.com/eazybijira/data-import/custom-fields/javascript-calculated-custom-fields.

Please have a look at the picture below:

Screen Shot 2020-03-02 at 10.52.45.png

This is the configuration I will use in the example import. I will try to import the "Summary" column as a dimension. For that, we will use a REST API call bellow:

JIRA_BASE_URL/rest/idalko-igrid/1.0/grid/AAAAA/issue/NNNNN

Where AAAAA is the ID of the Table Grid editor custom field and NNNNN is the ID of each Jira issue the field is in.

Please add the code below to the eazyBI advanced settings:

[jira.customfield_tbl_summary]
name = "Tbl Summary"
data_type = "string"
dimension = true
multiple_values = true
split_by = ","
javascript_code = '''
getDocument("/rest/idalko-igrid/1.0/grid/AAAAA/issue/" + issue.id, {ignoreErrors: [404,400]},
function(result){
resultArray = [];
if (result && result.values) {
    result.values.forEach(function(valuesItem){ 
resultArray.push(
valuesItem.isummary
);
   })
}

issue.fields.customfield_tbl_summary = resultArray.toString();
});
'''

Make sure to replace AAAAA with the ID of the Table Grid custom field. Also, change the line valuesItem.isummary to the columns ID. You can see the ID when you edit the custom field in Jira. Please have a look at the picture below:

Screen Shot 2020-03-02 at 11.06.52.png

Update the eazyBI advanced settings and select the custom field for import in the eazyBI import options "Custom fields" tab.

 

We do have an improvement regarding the integration with Table Grid editor on our backlog. I added your vote to it. In the meantime, let me know if you have any questions about the proposed workaround.

 

Best,

Roberts // support@eazybi.com

Tanu March 11, 2020

Hi @Roberts Čāčus 

I really appreciate your detailed help, it matters a lot.
I tried same and i was not able to Import Using REST API

getting below Error , i have put JIRA URL here in place of my actual URL.

Received HTTP 406 error when requesting JIRA-URL/rest/idalko-igrid/1.0/grid/11507/issue/42000

Not sure where i am committing mistake, can you please guide me .

Roberts Čāčus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2020

@Tanu  were are you running the REST API request? Please see the expected output when run from a browser where you are logged in Jira.

Screen Shot 2020-03-20 at 10.11.22.png

The 406 error is an unexpected one - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406.

Did you try to go ahead with the configuration in eazyBI advanced settings?

 

Best,

Roberts // support@eazybi.com

Alexander Kondakov September 22, 2020

Hi @Roberts Čāčus 
And what about numeric values ?

For example, in your table above we add a column "inum" where we could insert integer and decimal values.
And we need to load summary and a new column (inum) as a measure (we need to get a sum of values in this column for each assignee in eazyBI).
I just managed to load numeric values like a string and dimension (as in your example).
But I need a measure with numeric value.
Could you help with this ?

Roberts Čāčus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2020

Hi @Alexander Kondakov ,

 

That is a rather specific use case. Let us continue addressing it in our ongoing internal discussion.

 

Best,

Roberts // support@eazybi.com

Amrut Bhonsle June 24, 2021

@Roberts Čāčus

Would this approach work on cloud with the 'next gen table grid' plugin 

Roberts Čāčus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2021

Hi @Amrut Bhonsle ,

 

In Cloud, the Table Grid Next Generation app stores data differently - in issue properties. Thus, the approach described above won't work.

I will use a similar example with the "Summary" column as in the original answer. See the picture of the table and its column configuration below:

Screenshot 2021-07-06 at 11.39.20.pngScreenshot 2021-07-06 at 11.41.50.png

The parameters for the eazyBI advanced settings could look similar to the ones below:

[jira.customfield_gridSummary]
name = "Table Summary"
data_type = "string"
dimension = true
multiple_values = true
split_by = ","
javascript_code = '''
var baseURL = '/rest/api/latest/issue/' + issue.id;
var rq_url = baseURL + '?properties=*all';
var obj = getDocument(rq_url);
var gridData = obj.properties;
var resultArr = [];
if (gridData!=null) {
if (gridData["60def68e0f28af0ea78b8509"]!=null) {
var gridRows = gridData["60def68e0f28af0ea78b8509"].rows;
for (i = 0; i < gridRows.length; i++) {
resultArr.push(gridRows[i].columns.jsummary);
}
issue.fields.customfield_gridSummary = resultArr.toString();
}
}
'''

The parameters that are subject to change are the column ID - "jsummary". It is taken from the table column configuration.

And he table ID - "60def68e0f28af0ea78b8509". For now, the only way I managed to find the unique table identifier is through the custom JavaScript code in the eazyBI import options.

var baseURL = '/rest/api/latest/issue/' + issue.id;
var rq_url = baseURL + '?properties=*all';
var obj = getDocument(rq_url);
var gridData = obj.properties;
console.log(obj.properties);

Suppose you have only one table in that particular issue. In that case, the response should be similar to the one below and the table ID highlighted:

Screenshot 2021-07-06 at 11.54.43.png

Update the JavaScript code to fit your use-case and test the JavaScript code (only the JavaScript code part) in the eazyBI import options "Custom JavaScript code" editor with a particular Jira issue. Remember to remove the custom code after testing!


After retrieving the desired result, update the eazyBI advanced settings with the parameters, and select the newly defined custom field for import.

 

Best,

Roberts // support@eazybi.com

Suggest an answer

Log in or Sign up to answer