Before You Begin
Dashboard widgets in TestAuto2 are implemented as Velocity templates embedded in Polarion wiki pages. You’ll need:
- Project administrator or wiki editor permissions
- Basic understanding of Velocity Template Language (VTL)
- Access to the Documentation space where dashboard pages are stored
Locate the Dashboard Page
- Navigate to Documentation space in the sidebar
- Click Pages in the top menu
- Find the dashboard you want to customize (e.g., “Home Dashboard”, “Safety Engineer Dashboard”)
- Click Edit in the toolbar
Alternatively, open the SVN working copy:
svn/working/TestAuto2/.polarion/pages/spaces/Documentation/<PageName>/page.xml
Dashboard pages live in .polarion/pages/ in SVN. Changes made through the Polarion UI are immediately committed. Always update your working copy before editing locally via SVN.
Dashboard pages use the rich-page layout with script block widgets:
┌─────────────────────────────────────────┐
│ #import('nextedy_solutions.vm') │ ← Macro library import
│ #nxInit() │ ← Initialize Nextedy context
│ #nxCommonStyles() │ ← Inject CSS
├─────────────────────────────────────────┤
│ #nxSpaceBanner(...) │ ← Header banner
│ #nxStatisticsBar(...) │ ← Metrics bar
│ #nxSectionHeader("Documents") │ ← Section title
│ #nxDocInventoryTree(...) │ ← Document list
│ #nxLinkCoverage(...) │ ← Traceability coverage
│ #nxKpiCard(...) │ ← Custom KPI card
│ #nxSpaceFooter() │ ← Footer
└─────────────────────────────────────────┘
All Nextedy macros are defined in nextedy_solutions.vm macro library.
Add a Custom KPI Card
To add a new metric card showing count of high-priority failure modes:
## Count failure modes with Action Priority = H
#set($highPriorityFmeas = $trackerService.queryWorkItems(
"type:failureMode AND postmitigationAP:H",
null
))
#nxKpiCard(
"High Priority FMEAs", ## title
$highPriorityFmeas.size(), ## value
"Require immediate action", ## subtitle
"red", ## color: red/orange/green/blue/purple
"/polarion/#/project/$projectId/workitems?query=type:failureMode+AND+postmitigationAP:H" ## drill-down URL
)
Place this code block between #nxSectionHeader() and the next section.
Use $trackerService.queryWorkItems(luceneQuery, sortBy) for work item counts. For document counts, use $documentService.getDocuments($projectId, spaceId, null).
Modify the Statistics Bar
The statistics bar displays real-time counts. To add a new artifact type:
Original:
#nxStatisticsBar([
["Customer Requirements", "type:custReq"],
["System Requirements", "type:sysReq"]
])
Modified (add Design Requirements):
#nxStatisticsBar([
["Customer Requirements", "type:custReq"],
["System Requirements", "type:sysReq"],
["Design Requirements", "type:desReq"]
])
Each array item is [displayLabel, luceneQuery].
Customize Traceability Coverage Metrics
To change which link role is tracked in a coverage bar:
Original (verifies link):
#nxLinkCoverage(
"System Requirements",
"type:sysReq",
"verifies",
"back",
"System Verification Coverage"
)
Modified (track refines link instead):
#nxLinkCoverage(
"System Requirements",
"type:sysReq",
"refines",
"forward",
"System Refinement Coverage"
)
Parameters: (title, baseQuery, linkRole, direction, coverageLabel)
direction: "forward" for linkedWorkItems, "back" for backlinkedWorkItems
Gap queries in #nxLinkCoverage are auto-generated. If you change the link role, verify the gap count drill-down URL still works by clicking the icon.
Add Multi-Hop Coverage (Advanced)
For complex traceability like “SC/CC Design Requirements → Characteristics → Failure Modes”:
## Query SC/CC design requirements
#set($scccReqs = $trackerService.queryWorkItems(
"type:desReq AND classification.KEY:(sc cc)",
null
))
#set($covered = 0)
#foreach($req in $scccReqs)
## Get back-linked characteristics via 'refines'
#set($chars = $req.fields().linkedWorkItems().back())
#foreach($char in $chars)
#if($char.type == "characteristic")
## Check if characteristic has back-linked failure modes
#set($fmeas = $char.fields().linkedWorkItems().back())
#foreach($fmea in $fmeas)
#if($fmea.type == "failureMode")
#set($covered = $covered + 1)
#break
#end
#end
#end
#end
#end
#set($coverage = $mathTool.roundTo(2, ($covered * 100.0 / $scccReqs.size())))
#nxCoverageBar(
"SC/CC to FMEA Coverage",
$coverage,
$covered,
$scccReqs.size()
)
This pattern implements transitive traceability checking across multiple link hops.
Change Dashboard Color Scheme
Role dashboards use custom color themes. To change the Safety Engineer dashboard from orange to blue:
CSS in page.xml:
<style>
.banner { background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%); }
.stat-card { border-left: 4px solid #1976d2; }
</style>
Standard Nextedy color palette:
- Red:
#c62828 / #e53935
- Orange:
#e65100 / #f57c00
- Green:
#2e7d32 / #43a047
- Blue:
#1565c0 / #1976d2
- Purple:
#4527a0 / #5e35b1
Add a Custom Link Card
To add a navigation card to a new report:
#nxLinkCardsGrid()
#nxLinkCard(
"Control Plan Report", ## title
"Manufacturing control plan coverage and metrics", ## description
"/polarion/#/project/$projectId/wiki/Documentation/Control%20Plans%20Report", ## URL
"dashboard" ## icon
)
#nxLinkCard(
"FMEA Summary",
"DFMEA and PFMEA overview with Action Priority distribution",
"/polarion/#/project/$projectId/wiki/Documentation/FMEA%20Reports",
"table"
)
#nxLinkCardsGridEnd()
Available icon values: dashboard, table, chart, report, document, link.
Test Your Changes
- Save the page in Polarion UI (or commit via SVN)
- Refresh the dashboard in your browser
- Verify counts match expected values
- Click drill-down links to confirm gap queries work
- Test on different screen sizes for responsive layout
Use browser DevTools Console to debug Velocity errors. Polarion will display stack traces if a macro fails to render.
Common Pitfalls
| Issue | Cause | Solution |
|---|
| ”Method not found” error | Missing #nxInit() call | Always call #nxInit() after importing macro library |
| KPI shows 0 when data exists | Incorrect Lucene query syntax | Test query in Work Items Tracker first |
| Coverage bar shows NaN% | Division by zero (empty base query) | Add #if($total > 0) guard before math operations |
| Page layout breaks | Missing #nxLinkCardsGridEnd() or #end | Validate all macro blocks are properly closed |
| Changes not visible | Browser cache | Hard refresh with Ctrl+Shift+R (Win) or Cmd+Shift+R (Mac) |
Verification
You should now see your customized dashboard with modified metrics, new KPI cards, or updated color scheme. Drill-down links should navigate to filtered Work Items Tracker views showing the queried artifacts.
See Also