The core issue is that Polarion’s calculated fields don’t automatically recalculate based on changes to linked work items - they only recalculate when the work item itself is modified. Let me provide a comprehensive solution covering all aspects:
Reverse Traceability Configuration:
First, ensure your reverse traceability is properly configured. In your requirement work item configuration, define the reverse link:
<custom-field id="linkedRisks" type="reference">
<linkRole opposite="impacts"/>
<calculation>LINKED_ITEMS(impacts)</calculation>
</custom-field>
This establishes the reverse relationship foundation, but doesn’t solve the auto-update issue.
Attribute Mapping with Triggers:
Your calculated field formula is correct, but needs an automation trigger. The most efficient approach is a workflow post-function on risk items that updates linked requirements. Add this to your risk workflow XML:
<post-function class="com.polarion.alm.tracker.workflow.UpdateLinkedItems">
<arg name="linkType">impacts</arg>
<arg name="touchLinkedItems">true</arg>
<arg name="triggerRecalculation">true</arg>
</post-function>
This post-function triggers whenever a risk transitions or is updated, forcing recalculation on linked requirements.
Automation Triggers for Field Changes:
For more granular control, implement a custom workflow condition that triggers only when probability or impact fields change:
- Create a workflow function that checks if risk score fields were modified
- If modified, iterate through linked requirements using the “impacts” link
- Call the Polarion API to touch each requirement (update a hidden timestamp field)
- This forces recalculation of the riskExposure calculated field
The workflow function would execute on every risk save operation, but only triggers requirement updates when scores actually change.
Risk Recalculation Optimization:
To avoid performance issues with large numbers of requirements, implement a batched approach:
- Instead of updating requirements immediately, add them to a recalculation queue
- Run a scheduled job every 15-30 minutes that processes the queue
- Batch update requirements in groups of 50 to minimize database load
- Clear the queue after processing
This balances real-time needs with system performance.
Alternative: LiveReport Dashboard:
For immediate risk visibility without touching work items, create a LiveReport dashboard that queries current risk scores:
SELECT req.id, req.title,
SUM(risk.probability * risk.impact) as currentRiskExposure
FROM requirement req
JOIN risk ON risk.impacts = req.id
WHERE req.project = 'YOUR_PROJECT'
GROUP BY req.id
This report always shows real-time risk data without requiring field propagation. Users can reference this dashboard for prioritization decisions.
Immediate Solution:
For your current situation, implement a scheduled automation job:
- Administration > Automation > Create New Job
- Schedule: Every hour during business hours
- Query: Find requirements with risk links modified in last 2 hours
- Action: Force field recalculation by updating a timestamp
This provides near-real-time updates (within 1 hour) without complex workflow modifications.
Best Practice Recommendation:
Combine approaches for optimal results:
- Use workflow post-functions for critical high-priority requirements (immediate update)
- Use scheduled jobs for standard requirements (hourly batch update)
- Provide LiveReport dashboards for real-time risk visibility without field dependencies
This hybrid approach balances performance, real-time needs, and system complexity. The workflow function handles immediate updates for critical items, while scheduled jobs efficiently process bulk updates for the broader requirement set.