Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to pull grid data into a eazybi report

devashree ma March 13, 2020

Hi,

Query1:

I tried the code suggested earlier for a grid data to be imported in  eazy bi report.

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

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

 

But this is not working. Please let me know what changes need to be made.

I have placed a screenshot of the way isite is defined.

 Query2:

For grid column with data type as interger/number i m not able to import the column even though i mention measure as true:

One such code is below:


[jira.customfield_DAO]
name = "Tbl DAO"
data_type = "integer"
measure = true
multiple_values = true
split_by = ","
javascript_code = '''
getDocument("/rest/idalko-igrid/1.0/grid/11075/issue/" + issue.id, {ignoreErrors: [404,400,406]},
function(result){
resultArray = [];
if (result && result.values) {
    result.values.forEach(function(valuesItem){ 
resultArray.push(
valuesItem.idao
);
   })
}

});
'''

 

Please let me know how i can changes this code to make it work.

 

Thanks in advance

Devashree

1 answer

0 votes
Gerda Grantiņa
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 19, 2020

Hi @devashree ma ,

It looks that your first query is correct, could you please check that in your eazyBI account Data Source -> Customfield tab you have selected your customfield "Tbl site" for the import?
(see more information about JavaScript customfields here - https://docs.eazybi.com/eazybijira/data-import/custom-fields/javascript-calculated-custom-fields )

For the second query, if you want it to be measure, then it is not correct to use those lines as for measures you can't have multiple values and split them with ",":

multiple_values = true
split_by = ","

 As well it seems there is no line for returning the result.

if you still have questions about this, please send a reference to this conversation and additional questions to support@eazybi.com (best together with PrintScreen and JS codes)

best,
Gerda // support@eazybi.com

devashree ma April 1, 2020

Hi Gerda,

I tried removing , 

multiple_values = true
split_by = ","

but still , i m not able to get the data in the report.

And what is the syntax for returning the result.

 

Thanks,

Devashree

Gerda Grantiņa
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.
April 1, 2020

Hi @devashree ma ,

Can you confirm that after adding this JavaScript in eazyBI advanced settings you have selected this field in data import?

If that is done and there are still problems, it would be better if you could please send a reference to this conversation and additional questions to support@eazybi.com (best together with PrintScreen and JS codes) as this is not the integration that eazyBI supports by default and some more information is needed.

best,
Gerda

devashree ma April 20, 2020

Hi Gerda,

Query1:

I tried the code suggested earlier for a grid data to be imported in  eazy bi report.

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

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

 

In this , the configuration for this grid data in jira shows that site is of type list.

col.isite=Site
col.isite.type=list
col.isite.query=SELECT DISTINCT GOQFactory as isite, GOQFactoryID as id FROM qim.RLOBGOQFactory WHERE GOQFactory IS NOT NULL AND IsActive = 1 AND IsDeleted = 0
col.isite.query.ds = C*****DB
#col.isite.required = true
#col.isite.required=true
col.isite.width=150

 

How do i change to code if the type is list?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events