Get field value of a related Test Document inside a report recipe
I am trying to create a Custom Recipe in PTC Integrity 10.9 for a report where I need to fetch the field value of a document that is related to the document that has been passed as an input to the report.
var fieldvalue1 = <%fieldname1%>;
var fieldvalue2 = <%fieldname2%>;
Here, I want the fieldvalue2 to be value of the field "fieldname2"as per the document that I got as "fieldvalue1".
I am very new to Integrity custom report creation. Appreciate your help.
Re: Get field value of a related Test Document inside a report recipe
To specify a relationship field rather than the item field, you need to use <%Relationship fieldname2%>, within the <%beginrelationshipdetail relationshipname%> section of the report.
There are some example report recipes using relationships (e.g. Detail - HTML, Row, Relationships). If you create a report using the recipe, then view the report on the CLI using im viewreportreportname, you can see how the field values are defined. Here's a sample relationship section of a report created from the Detail - HTML, Row, Relationships recipe:
<!-- Relationships info -->
<td colspan="4" class="border">
<span class="bold_color_underline">Documented By:</span><br>
<%beginrelationshipsdetail Documented By%>
<!-- Display relationship issue field headings -->
<th>Document Short Title</th>
<!-- Display no relationships found -->
<tr><td>No related items.</td></tr>
<!-- Display relationship issue field values -->
<td><%Relationship Document Short Title%></td>