Bug in Synchronize Attributes feature?
Marko Tomljenovic (316●50●109)
| asked Jan 13 '17, 8:35 a.m.
retagged Jan 20 '17, 4:40 p.m. by Ken Tessier (841●1●7) In the Eclipse client there is the menu “Synchronize Attributes” that is used to update the attributes of existing work items in case the process template has changed and some new attributes have been added or old attributes are not available any more. Looking at the invoked code it comes down to WorkItemCommon.updateWorkItemType(...) where the newType and oldType parameter are the same instance and this instance is the work item type of the current (meaning new) process template.
public boolean updateWorkItemType(IWorkItem workItem, IWorkItemType newType, IWorkItemType oldType, IProgressMonitor monitor) throws TeamRepositoryException {Looking at the code it seems to me that attributes that are available in the work item but not any more in the work item type (of the new process template) are never removed. Removal of attributes only work if newType and oldType are different. This could be solved by replacing line for (IAttributeHandle customAttribute: oldType.getCustomAttributes()) {by for (IAttributeHandle customAttribute: workItem.getCustomAttributes()) {Am I missing something here? Marko |
2 answers
Ralph Schoon (63.5k●3●36●46)
| answered Jan 13 '17, 10:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Marco, I would submit an enhancement request. I am not sure if this is as planned or not. There might be reasons.
Comments When I am changing the the type from let's say Task to Story then the not anymore used attributes in Task are removed. But when I am "updating" the Task work item the attributes are not removed.
This piece of code is invoked when I change the type of a work item in the Eclipse editor:
In the end I can live with the current behaviour of the implementation but then the javadoc should be adapted to explain the real behaviour:
Create a defect or enhancement request Marko.
Geoffrey Clemm
commented Jan 22 '17, 6:01 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I agree this is inconsistent, so I'd start with filing it as a defect.
|
There is a defect on this:
Comments
Geoffrey Clemm
commented Jul 26 '17, 7:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note that although this is working as designed, I agree with Marko that the design has the inconsistency problem that he identifies above. But unfortunately, since the current behavior was introduced in release 2.0, it probably is not safe at this point to change that design, because customer processes are likely to have been created that depend on this design not changing. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.