It's all about the answers!

Ask a question

How to access Attributes of Workitems

Sarthak Sharma (4711620) | asked Jun 28 '12, 4:25 a.m.
retagged Jun 28 '12, 4:44 a.m. by Arne Bister (2.6k12832)
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
How Can I do that ?

Accepted answer

permanent link
sam detweiler (12.5k6195201) | answered Jun 28 '12, 8:14 a.m.
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)


Sarthak Sharma selected this answer as the correct answer

One other answer

permanent link
Muthukumar C (32712833) | answered Jun 29 '12, 12:49 a.m.

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.


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.