It's all about the answers!

Ask a question

Can you update the work item attribute "id"

Neil Plantan (1082215) | asked Aug 24 '12, 12:50 p.m.
edited Aug 24 '12, 12:51 p.m.
I have a customer with approx. 20 very similar project areas in one repository. The Defect work item contains a number of custom attributes.  The attribute name is the same across the project areas but the customAttribue id's are different.  This is causing problems moving work items across project areas.  Can the customAttribute be updated in the process XML?

Accepted answer

permanent link
Ralph Schoon (63.0k33645) | answered Aug 28 '12, 9:21 a.m.
Thinking about it, I would probably left the old attribute, created a new attribute with the correct ID, fixed the editor presentations , renamed the display name of the old one to zz_ignore. the I would have written a simple tool that goes through all work items and copies the data over. No corruption of data could happen.
Neil Plantan selected this answer as the correct answer

Neil Plantan commented Oct 05 '12, 3:38 p.m.

Thanks Ralph, went this route to be safe

4 other answers

permanent link
Ralph Schoon (63.0k33645) | answered Aug 24 '12, 5:40 p.m.
You should be able to modify the display name, but you will not be able to modify the ID

Neil Plantan commented Aug 24 '12, 9:14 p.m.

Ralph, what I would like to do is modify the id so I can move work items across projects, the display names are already the same. The GUI does not allow this but the XML does. If I change it will it do you know if it will have any adverse affects?

permanent link
Ralph Schoon (63.0k33645) | answered Aug 27 '12, 3:51 a.m.

I don't think I understand what, why and how you want to work.

The ID is actually used as index in the database and I think you can only have one work item with one ID. Using the API you can force an ID, but if it is already taken you will get an exception. I can only discourage this. It would be better tho use a link between the relates work items to make navigation easier.

permanent link
Neil Plantan (1082215) | answered Aug 27 '12, 5:19 p.m.
Hi Ralph, the customer needs to be able to move and copy workitems across projects.  Today, they get about a dozen mapping errors when they try to copy or move a work item to another project.  The attribute exists in both project areas but the attribute id's are slightly different - he curse of multiple administrators.  I was able to change the **<customAttribute id="** in the process configuration source.  it does not look like it had any adverse affect on existing defects using this attribute.(still testing)  i am now able to move workitems across projects and no longer get the "Attribute not Found" error.

permanent link
Ralph Schoon (63.0k33645) | answered Aug 28 '12, 4:21 a.m.
edited Aug 28 '12, 4:21 a.m.
Hi Neil,

now I get what you mean with the ID. Honestly I haven't tried what you just did. I am not sure if it would have ill effects. The reason is that the Attribute ID is probably used for many DB operations, so I am not sure if you would end up with data in the DB that is related to an ID that is no longer there. The WorkitemCustomization Wiki topic talks about changing the ID of EnumerationLiterals and it mentions only to do that before the enumeration is first used. I would at least do some thorough testing (including reastarting the server and the clients to erase caches) to make sure you are not getting into trouble.

Your answer

Register or to post your answer.