Skip to main content

Hello,


I’m using the java sdk to add an enum option to the classification.


However, I can’t fill in the “classificationDefinition” and “colorID” arguments using the following code:



public JSONObject addEnumOption(String enumOptionKey, String key, String classificationDefinition, float colorID)

{

JSONObject classificationObject = new JSONObject()

.put("classificationDefinition", classificationDefinition)

.put("colorID", colorID)

.put("isTrialClassification", true);



JSONObject staticConfigObject = new JSONObject()

.put("classification", classificationObject);



JSONObject dataObject = new JSONObject()

.put("key", key)

.put("staticConfig", staticConfigObject);



JSONObject jsonObject = new JSONObject()

.put("op", "addEnumOption")

.put("fieldKey", "Box__Security__Classification__Key")

.put("enumOptionKey", enumOptionKey)

.put("data", dataObject);



return jsonObject;

}



JSONObject jsonObject = new FieldOperation().addEnumOption("TEST","test","test",4);

updates.add(new MetadataTemplate.FieldOperation(jsonObject.toString()));

return MetadataTemplate.updateMetadataTemplate(boxAPI.getAPI(), boxAPI.getScope(), Metadata.CLASSIFICATION_TEMPLATE_KEY, updates);



I’ve seen that it’s possible in our language like Node or curl. Do you know when this feature will be available for java?



thanks

Hi @arthurS20



Thanks for your question, I created a PR, we will let you know when the new version of Box SDK released.



Best,


Minh


Hi @mcong ! Thx for you response



Do you know when the next release is scheduled ?


Reply