It's all about the answers!

Ask a question

How to set null value to an workItem attribute


Marcelo Bilezker (46112) | asked Nov 17 '21, 8:18 p.m.

 

If I try to set a timestamp value to an attribute of a workItem it works fine
workItemCopy.setValue(attrVar, timeStampValue);
workItemClient.saveWorkItem(workItemCopy, null, monitor);

This is ok, BUT,

if instead of timeStampValue I put null, as in:
workItemCopy.setValue(attrVar, null);
workItemClient.saveWorkItem(workItemCopy, null, monitor);

If fails.
So the question is: how to set attrVar to null


Accepted answer


permanent link
Ralph Schoon (63.7k33648) | answered Nov 18 '21, 4:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 This works for me.

Marcelo Bilezker selected this answer as the correct answer

Comments
Marcelo Bilezker commented Nov 18 '21, 6:15 a.m.

ok. I think the field was set not be null. Thanks


 


Ralph Schoon commented Nov 18 '21, 6:22 a.m. | edited Nov 18 '21, 6:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you want me to continue to answer, please consider to provide necessary information  up front. E.g. check exceptions and the message you get. "It Fails" is not at all useful.

Also note that the built in timestamps (created, modified) are generated and can not be set. Only DueDate can.

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.