ReferenceFilterUnifier
* 
Corrections related to reference filters and tracker views are strongly connected, and each correction relies on inconsistencies being fixed by previous corrections.
Before using this correction, it is important to use the following correction:
RemoveInvalidReferenceFilters
* 
For a general, step-by-step guide on using the corrector module, see Using the Data Inconsistency Corrector Module.
Description
This correction detects discrepancies between information for reference filters stored in the object_reference_filter table and the object_revision table. It also provides a way to delete unneeded or redundant reference filters based on detected discrepancies.
Reference filters are stored in the object_reference_filter table. Changes to a field are stored in the object_revision table, which include adding or changing a reference filter applied to a field. This means that both tables contain information on reference tables. Ideally, these tables contain the same information regarding reference filters.
For example, if several reference filters are applied to the same field, those reference filters appear both in the object_reference_filter table and the object_revision table in the following ways:
object_reference_filter table—The reference filters appear as separate records.
object_revision table—The reference filters appear together in the description column, in JSON format.
Errors can sometimes cause discrepancies between the information stored in the object_reference_filter table and the object_revision table. For example, in older versions of Codebeamer, when one of these tables was updated, sometimes the other table failed to be updated correctly.
This correction identifies reference filters based on the following properties:
object_id
type_id
domain_type
domain_id
The following types of issues are detected by this correction:
Missing pair—This reference filter was identified in one table but not in the other one, that is, it is present only in either the object_reference_filter table or the object_revision table. These are marked as MISSING in the issue column of the report table.
Difference from pair—This reference filter was identified in both tables, but there is a discrepancy in some properties. These are marked as DIFFERENCE in the issue column of the report table. This means one or more of the following properties are different in the object_reference_filter table and the object_revision table:
qualifier
filter_id
status_id
Creating the Report Table
To create the report table:
1. Click Detect. The report table is created. Reference filters are identified and detected issues are listed. The Detect button is replaced by the Dry run and Reset buttons.
By default, the action column of the report table has the <null> (empty) value. Manual input is required to decide which reference filters are deleted.
Preparing the Report Table for Restore
Before using Restore, manual input must be entered in the report table.
To prepare the report table:
1. Decide how to handle each detected reference filter.
2. Change the <null> (empty) value in the action column to a valid input.
The following inputs are valid:
In case of missing pairs (MISSING in the issue column):
KEEP—The reference filter is marked to be kept.
If the reference filter was identified in the object_reference_filter table, clicking Restore copies it into the object_revision table.
If the reference filter was identified in the object_revision table, clicking Restore copies it into the object_reference_filter table.
DELETE—The reference filter is marked for deletion. Clicking Restore deletes this reference filter.
In case of difference from pair (DIFFERENCE in the issue column):
KEEP_LEFT—The reference filter on the left side of the report table is marked to be kept, and the one on the right is marked to be overwritten. That is, clicking Restore keeps the reference filter in the filter_from_object_reference_filter column and updates the reference filter in the filter_from_object_revision column to match it.
KEEP_RIGHT—The reference filter on the right side of the report table is marked to be kept, and the one on the left is marked to be overwritten. That is, clicking Restore keeps the reference filter in the filter_from_object_revision column and updates the reference filter in the filter_from_object_reference_filter column to match it.
DELETE_BOTH—Both identified reference filters are marked for deletion. That is, clicking Restore deletes the reference filters in both the filter_from_object_revision column and the filter_from_object_reference_filter column.
Dry Run
Before using Restore, a dry run must be performed. A dry run means running a simulation of this correction without affecting the rest of the database.
To do a dry run after clicking Detect:
1. Click Dry run. A new table named object_reference_filter_tmp is created based on the report table, including the manual inputs in the action column.
The Dry run and Reset buttons are replaced by the Restore and Reset dry run buttons.
2. Optionally, click Reset dry run. The object_reference_filter_tmp table is deleted.
The Restore and Reset dry run buttons are replaced by the Dry run and Reset buttons.
The object_reference_filter_tmp table simulates the final state of the database as it would exist after clicking Restore. That is, the object_reference_filter_tmp table contains the reference filters that are also contained in the object_reference_filter table and the object_revision table after this correction is used.
After the results of the dry run are validated, Restore can be safely used.
Report Table
The report table for the ReferenceFilterUnifier correction is named reference_filter_unifier_report_table. It contains the following information:
Column
Description
id
The ID number for the detected issue.
Detected issues are numbered, starting at 1.
field_id
The global ID of the field where an issue was detected.
* 
In the report table generated by the RemoveDuplicatedFields correction, this is called the field_object_id.
In the report table generated by the RemoveInvalidReferenceFilters correction, this is called the object_id.
filter_from_object_reference_filter
Shows the reference filter identified in the object_reference_filter table, in JSON format. If the reference filter is missing from that table, this value is <null> (empty).
filter_from_object_revision
Shows the reference filter identified in the object_revision table, in JSON format. If the reference filter is missing from that table, this value is <null> (empty).
issue
Shows the type of issue detected. The following values are possible:
MISSING—The type of issue is a missing pair.
DIFFERENCE—The type of issue is a difference from pair.
action
Contains the action to be performed when clicking Restore. By default, this value is <null> (empty). Manual input must be entered.
The following inputs are valid:
In case of missing pairs (MISSING in the issue column):
KEEP—The reference filter is marked to be kept.
DELETE—The reference filter is marked for deletion.
In case of difference from pair (DIFFERENCE in the issue column):
KEEP_LEFT—The reference filter on the left side of the report table is marked to be kept, and the one on the right is marked to be overwritten.
KEEP_RIGHT—The reference filter on the right side of the report table is marked to be kept, and the one on the left is marked to be overwritten.
DELETE_BOTH—Both identified reference filters are marked for deletion.
flag
The flagged status of the issue, which can be 0 or 1. Clicking Restore corrects issues with a flagged status of 1.
For more information, see the Flagging and Processing Inconsistencies page on the Codebeamer Help Center.
processed
The processed status of the issue, which can be 0 or 1.
For more information, see the Flagging and Processing Inconsistencies page on the Codebeamer Help Center.
Was this helpful?