How to null out a field in CA Agile Central using the Java Toolkit.

Document ID : KB000010242
Last Modified Date : 14/02/2018
Show Technical Document Details

This example will explain how to null out a non-required field by sending a null value in your request using the Java toolkit.


1. Make sure you have the gson.JsonNull class imported into your .java class file.


2. Create a new JSON Object.

JsonObject newDefectUpdate = new JsonObject();

3. Set the property using the add method and the JsonNull.INSTANCE class constant.

newDefectUpdate.add("c_CustomDate", JsonNull.INSTANCE );

4. Send your request for the artifact.

UpdateRequest updateRequest = new UpdateRequest("/defect/<OID>", newDefectUpdate);