I'm trying to modify the stock Test Plan report to include a column that lists defect keys in the Test Summary Table. I'm running into the problem that to get the defects I either need to provide the requirements, or executions from the test. This requires a nested for loop, which I can't figure out.
This is what I'm working with:
${prop(xporter.document.autofit,true)}
Key | Summary | Issue Assignee | Requirements | Defects | #TestExecutions | Latest Status |
${set(TestKeyIncluded, 'A')}
#{for tests}
#{if (%{'${statusesToShowFirst}'.trim().equals('') || ‘${statusesToShowFirst}’.contains(‘${Tests[n].TestStatus}’)})}
${set(TestKeyIncluded,%{'${TestKeyIncluded}'.concat('${Tests[n].Key},')})}
@{title=${Tests[n].Key}|href=${BaseURL}/browse/${Tests[n].Key}} | ${Tests[n].Summary} | #{if (%{!'${Tests[n].Assignee}'.equals('')})} ${fullname:Tests[n].Assignee} #{end} | #{for a=JQLIssuesCount|clause=key in testRequirements('${Tests[n].Key}')} | #{for a=JQLIssuesCount|clause=key in testRequirements('${Tests[n].Key}')} | ${jqlcount:issue in testTestExecutions('${Tests[n].Key}') and 'Test Plan' = ${Key}} | #{if (%{'${Tests[n].Latest Status}'.equals('FAIL')})} |
I've tried to iterate through what is pulling in the requirements:
#{for a=JQLIssuesCount|clause=key in testRequirements('${Tests[n].Key}')}
${JQLIssues[a].Key}
#{end}
like this:
#{for a=JQLIssuesCount|clause=key in testRequirements('${Tests[n].Key}')}
#{for b=JQLIssuesCount|clause=key in defectsCreatedForRequirement(${JQLIssues[a].Key})}
${JQLIssues[b].Key}
#{end}
#{end}
Any suggestions on how to list defects on the Test Summary table in the Test Plan Xporter Report?
Thanks for sharing your use case!
If I understood correctly you're trying to include defects per test in a Test Plan report and you’re entering an advanced usage pattern of Xporter templates that may require nested JQL clauses and dynamic loops. These setups can be quite sensitive to template syntax and execution context, especially when involving multiple levels of issue relationships like Test → Test Execution → Defect.
Since this may involve deeper troubleshooting on how your data is structured or how the template engine is interpreting your loops, I’d recommend reaching out to Xray Support directly.
They’ll be able to look at your specific instance and template in more detail.
Best,
Francisco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.