How to access Attributes of Workitems
![]()
Sarthak Sharma (47●1●15●20)
| asked Jun 28 '12, 4:25 a.m.
retagged Jun 28 '12, 4:44 a.m. by Arne Bister (2.6k●1●28●32)
I am coding a plugin , in which I need to set the attributes of a work item.
If I have IWorkItem instance available and the attribute ID as well then, How Can I do that ? |
Accepted answer
![]()
1. an Advisor cannot change attributes.. but a Participant can
2. you must get the WorkingCopy of the IWorkitem object, otherwise it is read only 3. there are methods on IWorkitem to set the builtin attributes, for example setPriority(Identifier<IPriority> value)
Sets the priority to the given identifier. and setValue(IAttribute attribute,
java.lang.Object value)
Sets the value of the given attribute. for all the rest (custom attributes) Sam Sarthak Sharma selected this answer as the correct answer
|
One other answer
![]()
Sam,
I disagree with the point 1. Actually the rule is that "You should not write code in Operation Advisors to modify a field of a Work item". It does'nt mean that it won't work if you use setvalue method in Operation Advisor.. I have tested the setvalue method in the Operation Advisor itslef [Server Side] and it is working fine. Regards Muthukumar.C |