Sometimes a Work Item field is based on fields of linked Work Items. For such a use case, Polarion offers calculated fields. These fields then depend on fields of the linked parent or itself.
Unfortunately, this feature is limited to the data types Integer, Float, Currency, and Duration for the fields Initial Estimate, Time Spent, and Remaining Estimate.
Because of the limitations of the calculated fields feature, it can sometimes be easier to sync the content of fields between linked Work Items. This allows you to keep using all the already existing widgets and scripts since the information is part of the Work Item and does not need to be calculated in the background, which would not work with the existing widgets and scripts.
NOTE: In general, it is a bad idea to sync information from one place to another and thus have duplicate information instead of dynamically compiling that information from the source. When the syncing mechanism is automated and combined with well-thought-out limited write permissions, the approach does not violate the single source of truth philosophy. The data is only changed in one Work Item but propagated to further Work Items.
The motivation for the implementation of this hook is that the Tasks in our project management in Polarion are linked to higher-level clusters. For those clusters, we want to know when will the first Task start and when will the last Task end/be due. By syncing the earliest start day and last due date of all linked Tasks, this information is directly available with the cluster Work Item and usable in all already existing widgets.
Since the calculated fields feature does not support the data type Date, we needed to implement something on our own and decided to use the Work Item Action Interceptor Framework for this.
Supported field types are (source and target type must match):
- Date time
CAUTION: Carefully follow the configuration instructions on the project page! Otherwise, you might end up with infinite loops of sync operations and render your Polarion server unusable until you change the configuration!