It's all about the answers!

Ask a question

Operational Participant referring to the the deleted attribute

Surender Biyyala (403748) | asked Nov 15 '14, 3:44 p.m.
 Hi All,

I encountered a plugin which need to access an attribute and then does some stuff around that.

My case is I have an attribute which is an integer type as part of the requirement we need to modify it to use the enumeration so I deleted the existing attribute which is of type integer and then created anew attribute whose type is enum.

now MY plugin worked fine when it is using the Integer filed and now I change my code to access the new attribute but some how it is returning null.

to my surprise it is returning an object when I use the old attribute id (The workitem template is no more using that old attribute).

How the plugin is able to access a deleted attribute?


sam detweiler commented Nov 15 '14, 4:09 p.m.

Workitems created before your change will still have the old attribute. Once created they cannot be deleted.

Surender Biyyala commented Nov 15 '14, 4:15 p.m.

I`m not able to get the details of the new attribute Even when I tried it for the new work items which are using the new attribute.


sam detweiler commented Nov 15 '14, 6:00 p.m.

a little more info please..

the IDs for the two attributes (old and new) are different, correct?

you cannot 'change' an attribute type.

the old attribute ID will still exist, because some the workitems have it.  u cannot reuse the ID.

One answer

permanent link
Ralph Schoon (63.2k33646) | answered Nov 17 '14, 5:33 a.m.
You can not reuse the ID with a different attribute type. You could have - if planned carefully - created a migration tool that translated the old number into an enumeration literal.

Secondly, enumerations are handled different from just an int number if it comes down to its values. See for some hints. In a server participant, I believe you would use IAuditableServer or IAuditableCommon rather than IAuditableClient, but the rest of the API should be pretty much the same.

Your answer

Register or to post 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.