•  
      request #31092 Add access to renderer's information
    Infos
    #31092
    Guilhem Bonnefille (CS) (gbonnefille)
    2023-07-17 11:09
    2023-02-22 16:46
    32696
    Details
    Add access to renderer's information

    A Tracker Report uses at least one renderer to decide which artifact's values should be displayed and in which order.

    As an API user, I wish to access this information, to be able to reproduce the « export as CSV » via API (for example).

    As possible implementations:

    1. add the renderer collection inside the report JSON structure

    2. add a tracker_report_renderer endpoint in the API

    API
    14.3
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2023-07-17
    Attachments
    Empty
    References

    Follow-ups

    User avatar

    On the anticipation part I'm not sure there is a real need. If you need to know what to expect before you loop over all the retrieved artifacts you can take a look at the values key of the first artifact of the set, for each value you have the type of field.

    I was not sure it is guaranteed that all fields are present, in the case of non valuated field. But you are right, if all fields are effectively always present, so the first result can also serve to identify the columns.

    User avatar
    Thomas Gerbet (tgerbet)2023-07-07 17:42

    But I'm not able to anticipate the list of columns I will obtain, nor the order defined by the Report author.

    Indeed the column rank is not respected by this endpoint, it probably should.

    On the anticipation part I'm not sure there is a real need. If you need to know what to expect before you loop over all the retrieved artifacts you can take a look at the values key of the first artifact of the set, for each value you have the type of field.


    • Status changed from Closed to Reopen
    • Close date cleared
    User avatar

    Sorry, I fear my description of the problem was not clear or I did not understand your answer.

    When using the API, /tracker_reports/:report_id/artifacts?values=from_table_renderer I effectively obtain the filtered result I expect. But I'm not able to anticipate the list of columns I will obtain, nor the order defined by the Report author.

    I imagined I can request such information in the /tracker_reports/:report_id or /tracker_reports/:report_id/table_renderer.

    User avatar
    Thomas Gerbet (tgerbet)2023-07-07 17:00

    Hello,

    Closing as this is already supported.

    It is possible to call the REST API endpoint /tracker_reports/:report_id/artifacts?values=from_table_renderer (note that you cannot have multiple table renderer in that report). This how the document generation plugin works. You can see it in action in this tracker: go to the report, open the "Export" button, click on "Generate cross tracker documents" (feature was mainly planned to do cross tracker exports hence the name), do not selection anything for the second and third level and click export.


    • Status changed from New to Closed
    • Close date set to 2023-07-07