Data import thr rest api

Hi,

I am trying to import data thr rest api, response json as below, please help to get the datas for “row_positioins” field and “values” field, thanks a lot

Below are the target data trying to be imported:
date,projectCategory,testDelivery
Jan 2020,UAT,1.07
Jan 2020,performance,10.33
Feb 2020,UAT,2.77
Feb 2020,security,15.89
Feb 2020,performance,24.00

The origional json as below:
{“report_name”:“L1-testDeliveryworkdays”,“query_results”:{“column_positions”:[[{“name”:“testDelivery”,“full_name”:"[Measures].[testDelivery]",“depth”:0,“format_string”:"#,##0.00",“annotations”:{“group”:“testDelivery”,“disable_drill_into”:“false”,“disable_drill_across”:“true”,“disable_drill_through”:“true”,“disable_drill”:“false”},“calculated”:true}]],“row_positions”:[[{“name”:“Jan 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Jan 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-01-01”,“span”:2},{“name”:“UAT”,“full_name”:"[Project Category].[UAT]",“depth”:1}],[{“name”:“Jan 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Jan 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-01-01”,“span”:2},{“name”:“performance”,“full_name”:"[Project Category].[performance]",“depth”:1}],[{“name”:“Feb 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Feb 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-02-01”,“span”:3},{“name”:“UAT”,“full_name”:"[Project Category].[UAT]",“depth”:1}],[{“name”:“Feb 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Feb 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-02-01”,“span”:3},{“name”:“security”,“full_name”:"[Project Category].[security]",“depth”:1}],[{“name”:“Feb 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Feb 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-02-01”,“span”:3},{“name”:“performance”,“full_name”:"[Project Category].[performance]",“depth”:1}],[{“name”:“Mar 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Mar 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-03-01”,“span”:3},{“name”:“UAT”,“full_name”:"[Project Category].[UAT]",“depth”:1}],[{“name”:“Mar 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Mar 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-03-01”,“span”:3},{“name”:“security”,“full_name”:"[Project Category].[security]",“depth”:1}],[{“name”:“Mar 2020”,“full_name”:"[Time].[2020].[Q1 2020].[Mar 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-03-01”,“span”:3},{“name”:“performance”,“full_name”:"[Project Category].[performance]",“depth”:1}],[{“name”:“Apr 2020”,“full_name”:"[Time].[2020].[Q2 2020].[Apr 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-04-01”,“span”:3},{“name”:“UAT”,“full_name”:"[Project Category].[UAT]",“depth”:1}],[{“name”:“Apr 2020”,“full_name”:"[Time].[2020].[Q2 2020].[Apr 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-04-01”,“span”:3},{“name”:“security”,“full_name”:"[Project Category].[security]",“depth”:1}],[{“name”:“Apr 2020”,“full_name”:"[Time].[2020].[Q2 2020].[Apr 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-04-01”,“span”:3},{“name”:“performance”,“full_name”:"[Project Category].[performance]",“depth”:1}],[{“name”:“May 2020”,“full_name”:"[Time].[2020].[Q2 2020].[May 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-05-01”,“span”:3},{“name”:“UAT”,“full_name”:"[Project Category].[UAT]",“depth”:1}],[{“name”:“May 2020”,“full_name”:"[Time].[2020].[Q2 2020].[May 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-05-01”,“span”:3},{“name”:“security”,“full_name”:"[Project Category].[security]",“depth”:1}],[{“name”:“May 2020”,“full_name”:"[Time].[2020].[Q2 2020].[May 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-05-01”,“span”:3},{“name”:“performance”,“full_name”:"[Project Category].[performance]",“depth”:1}],[{“name”:“Jun 2020”,“full_name”:"[Time].[2020].[Q2 2020].[Jun 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-06-01”,“span”:3},{“name”:“UAT”,“full_name”:"[Project Category].[UAT]",“depth”:1}],[{“name”:“Jun 2020”,“full_name”:"[Time].[2020].[Q2 2020].[Jun 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-06-01”,“span”:3},{“name”:“security”,“full_name”:"[Project Category].[security]",“depth”:1}],[{“name”:“Jun 2020”,“full_name”:"[Time].[2020].[Q2 2020].[Jun 2020]",“drillable”:true,“depth”:3,“start_date”:“2020-06-01”,“span”:3},{“name”:“performance”,“full_name”:"[Project Category].[performance]",“depth”:1}]],“values”:[[1.065934065934066],[10.333333333333332],[2.7681159420289854],[15.888888888888891],[24.0],[3.611353711790393],[23.435897435897434],[43.3776175164708],[6.664921465968586],[26.88148410124799],[47.4635912339249],[9.805778491171749],[23.421015897714117],[50.682957341269855],[18.448439620081412],[38.825039419367286],[45.186238830191805]],“formatted_values”:[[“1.07”],[“10.33”],[“2.77”],[“15.89”],[“24.00”],[“3.61”],[“23.44”],[“43.38”],[“6.66”],[“26.88”],[“47.46”],[“9.81”],[“23.42”],[“50.68”],[“18.45”],[“38.83”],[“45.19”]]},“definition”:{“columns”:{“dimensions”:[{“name”:“Measures”,“selected_set”:["[Measures].[testDelivery]"],“members”:[]}]},“rows”:{“dimensions”:[{“name”:“Time”,“selected_set”:["[Time].[Month].Members"],“members”:[],“bookmarked_members”:[]},{“name”:“Project Category”,“selected_set”:["[Project Category].[Project Category].Members"],“members”:[],“bookmarked_members”:[]}]},“pages”:{“dimensions”:[]},“options”:{“nonempty”:true},“view”:{“current”:“table”,“table”:{“row_dimension_headers”:{“Project Category”:true,“Time”:true}},“bar_chart”:{“stacked”:false,“vertical”:false,“swap_axes”:false,“data_labels”:false},“line_chart”:{“area”:false,“swap_axes”:false,“data_labels”:false},“pie_chart”:{“swap_axes”:false,“donut”:false,“show_legend”:true,“show_labels”:false,“data_labels”:false,“relative_size”:false},“scatter_chart”:{“show_labels”:false},“timeline_chart”:{“series_type”:“line”},“map_chart”:{“map_type”:“static”,“map_name”:“world-en”},“gantt_chart”:{“timescale”:“daily”},“gauge”:{“swap_axes”:false,“only_values”:false}}},“cube_name”:“Project”,“last_import_at”:“2020-06-28T17:03:59.000Z”}

Best Regards
Annie Gao

Hi @xinranmo,

Thank you for the JSON results of the REST API call to illustrate your use case. It looks like you are exporting the eazyBI report “L1-testDeliveryworkdays” results as JSON and then use it further as a data source to some other eazyBI account. I believe you have a good reason to do so.

In this case, I would recommend changing the format of report results export from JSON to CSV. It will make data mapping a lot easier. There are more details on how to export report results as CSV through REST API: https://docs.eazybi.com/eazybijira/set-up-and-administer/set-up-and-administer-for-jira-server/customization/report-results-export-api.

Also, make sure to mark CSV as a content type in the data import screen.

Best,
Zane / support@eazyBI.com

Hi zane,

it is working with csv, thanks a lot!

but it cannot recognize date format and take them as string, I am trying to change it with java script code, could you please let me know how to make it working? The string format like “Jan 20”, please help, thanks a lot

Best Regards
Annie Gao

Hi @xinranmo,

You might want to slightly improve the source data, report “L1-testDeliveryworkdays”.
Add to the report one more column that would return the full date for each period. And then you could use that column for mapping data to the Time dimension.

  1. In the eazyBI report “L1-testDeliveryworkdays”, add a calculated measure that returns the 1st date or the last date of the selected period. The formula might look like this:

    [Time].CurrentHierarchyMember.StartDate
    
  2. Then eazyBI data mapping screen might look like in the picture below:

Best,
Zane / support@eazyBI.com