Operational Participant referring to the the deleted attribute
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?
Thanks
Surender.
One answer
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 https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/ 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.
Secondly, enumerations are handled different from just an int number if it comes down to its values. See https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/ 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.
Comments
sam detweiler
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
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
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.