How to clear the value from Date Field using script?

I want to update the date field with null value. Please help me on this.

No Files Were Attached
johnvinosh Agile User Asked on June 12, 2018 in Product Collaboration.
Add Comment
1 Answer(s)

Simple.  From one of my groovy scripts:

change.setValue(2002, null); //Set the Date field, in this case Base ID 2002, to null.
//you could have also written it like <change.setValue(ChangeConstants.ATT_PAGE_TWO_DATE01, null);>

Let us know if you need more help.

Matt Paulhus Agile Angel Answered on June 12, 2018.

Thanks Matt. It works !!!

on June 14, 2018.

I’m hoping to piggy back off this question. When I use setValue(####, null) it sets the value to empty string if it’s a multitext attribute. How do I remove the value? When an Item is originally created, calling getValue() on a Attribute that has not been set returns null, but once the value is set, it seems I can never get rid of the value, as empty string is still a value.

on August 29, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.