How does RTC determine literal id for a custom enumeration attribute?
RTC 4.0.5 used.
The user add enumeration attribute with some values and the configuration source will show <enumeration attributeTypeId="ErrorCategoryEnum" name="Item"> <literal default="true" id="ErrorCategoryEnum.literal.l2" name="item1"/> <literal id="ErrorCategoryEnum.literal.l4" name="item2"/> <literal id="ErrorCategoryEnum.literal.l6" name="item3"/> <literal id="ErrorCategoryEnum.literal.l8" name="item4"/> In another project, when adding similar Item enumeration attribute, it will show <enumeration attributeTypeId="ErrorCategoryEnum" name="Item"> <literal default="true" id="ErrorCategoryEnum.literal.l1" name="item1"/> <literal id="ErrorCategoryEnum.literal.l2" name="item2"/> <literal id="ErrorCategoryEnum.literal.l3" name="item3"/> <literal id="ErrorCategoryEnum.literal.l4" name="item4"/> Since there is an external program to check with literal id, they want to make them consistent. There are manual way to change literal id in the configuration source etc. The question here is: How does RTC determine the literal id for the custom enumeration attribute as it does not make sense it assign sequential id in one PA but even id in another one? Thanks |
Accepted answer
For what it is worth, I did a quick test and found that enumerations added in the web GUI had the sequential literals, while in the Eclipse client even-numbered. Can't really say why the two clients behave differently. I'm using RTC 4.0.6.
So if it is designed this way and you want sequential literals, add the enumerations in the web GUI, not the Eclipse GUI. Don Yang selected this answer as the correct answer
Comments
Don Yang
commented May 26 '14, 3:44 a.m.
Thanks Donald for this info. I now know we need to find out why Eclipse and Web client have different behavior(as usual).
|
2 other answers
I have only ever seen the 2 step assignment
I2, I4, I6 ... if you want specific IDs, I edit the source after creation but BEFORE saving to set the values as I want them. I always recommend to use a class notation for the ID string id=com.company.enum.value.name name=name |
The ID value can be changed, but any work items that are using that literal value will actually show the ID in the associated attribute, not the name. If you really want to go that route I suggest the following
Comments
sam detweiler
commented May 23 '14, 9:35 a.m.
step 3 is the hard part.. and note that reports will be messed up for a while.
Don Yang
commented May 23 '14, 6:55 p.m.
Thanks Kevin for the details.
sam detweiler
commented May 23 '14, 7:47 p.m.
I think the built in enums are sequential. all new are even numbered
Don Yang
commented May 28 '14, 9:12 p.m.
one interesting info to share here is that if using [Duplicate] instead of [Add] to create a new enum, then literal ids will be sequential, not even numbered.
sam detweiler
commented May 28 '14, 9:41 p.m.
Interesting indeed. Thanks for that info. |
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.