Advanced Word Export
Codebeamer 20.07 introduced a new, advanced document export functionality, giving template developers access to Codebeamer tracker data with the help of cbQL queries. While existing templates continue to work, the new functionality allows the creation of complex documents from multiple from across multiple trackers.
Basic Functionality
Templates can now include cbQL queries in the parameters section, the results of which can be referenced and iterated using bookmark loops. To do that, you need to:
1. Define a query, as described below in the Query parameters.
2. Create a loop_{queryName}bookmark loop.
3. In the loop, reference the attributes of the items returned by the query execution as a merge field <<{queryName}.{attribute}>>
This will result in listing the {attribute} attribute of all the resulting items of the {queryName} query.
Multiple Interdependent Queries
Multiple queries must reference each other and be built in a tree of queries, similar to the multi-level filtering of the Traceability Browser.
Once you’ve defined your queries as per the Query parameters table, you can embed bookmark loops. These loops iterate through the results of the related queries in other bookmark loops. To achieve this, the inner loop needs to reference the external loops. To do so:
1. Define your queries, such as named epic and userStory.
2. Create a bookmark loop referencing the outer query loop_{outerQueryName}. For example, loop_epic.
3. Create the inner bookmark loop referencing both the inner and the outer queries: loop_{outerQueryName}_{innerQueryName}. For example, loop_epic_ userStory.
4. Reference the attributes of the items returned by the inner query as a merge field as follows: <<{outerQueryName}.{innerQueryNamen.{attribute}>> . For example, <<epic.userStory.id>> ).
Context Dependent Templates
For context-dependent exports, templates can also refer to the items selected on the UI for export as if cbQL queried them.
To do that, queries need to be created that are set to depend on a special initial level named item, as per the following example:
<<query.epic.dependson>> = item
Respectively, the results of a similar query can be referred to as follows:<<item.epic.id>>d
The main concept is to use the term item as the initial level, instead of the actual initial level.
The Initial level table is unnecessary in the template parameters, and the Depends on value of the first level must refer to it as item
The bookmarks should also refer to this level as item.
The export has to be started from an item details page.
Was this helpful?