Create a document report with descendants

The following flow demonstrates how to generate a document report with a rest API, including entity descendants.

Overview

When working with entities, it is often important to view information about the descendants that were created under the entity.

For example, when looking at test runs under a given feature, we see test runs that were related directly to the feature (that ran tests directly related to that feature). You can also view test runs related to descendants of the feature entity, such as user stories.

You can show test runs for a feature along with the runs for its related user stories. In the above example, when you indicate to include descendants for the feature, it will also return the tests runs related to the user stories.

The REST API's include_all_descendants field corresponds to the Descendant inclusion option in Insights. To include the descendants in your report, set the field to true: "include_all_descendants": true.

In the example below:

Feature A

> Test A

> run A

> Story B

> Test B

> run B

  • If you do not include descendants, it will only return test run A.
  • If you include descendants, it will return test runs A and B.

Note: Descendant inclusion is only relevant for hierarchical entities, such as work_item, test, requirement, and application module.

Back to top

Example - Hierarchical entity with a direct relation

The following example illustrates the generation of a document report in PDF format in which include_all_descendants was set to true. It will return all tests covering the descendants of the work_item entity.

{
   "document_type":"PDF",
   "document_orientation":"PORTRAIT",
   "timezone":"UTC+03:00",
   "file_name":"Octane_Doc_Report.pdf",
   "report_entries":[
      {
         "entity_name":"work_item",
         "fields":[
		"id", "name"
         ],
         "layout":"DETAILS",
         "report_entries":[
            {
               "entity_name":"test",
               "fields":[
            		"id", "name"
                ],
               "related_field_name":"test",
               "include_all_descendants":true,
               "layout":"DETAILS"
            }
         ]
      }
   ]
}


 

Back to top

See also: