}
public Future<Response> add(final CCustomField customField) throws IOException {
if (customField.id != null) {
return asyncHttpClient.preparePut(capsuleUrl + "/api" + readContextPath() + "/" + id + "/customfield/" + customField.id)
.addHeader("Content-Type", "application/xml")
<BUG>.setRealm(realm)
.setBody(xstream.toXML(customField))</BUG>
.execute();
} else {
return asyncHttpClient.preparePost(capsuleUrl + "/api" + readContextPath() + "/" + id + "/customfield")

}
public Future<Response> add(final CCustomField customField) throws IOException {
if (customField.id != null) {
return asyncHttpClient.preparePut(capsuleUrl + "/api" + readContextPath() + "/" + id + "/customfield/" + customField.id)
.addHeader("Content-Type", "application/xml")
.setRealm(realm)
.setBodyEncoding("UTF-8")
.setBody(xstream.toXML(customField))
.execute();
} else {
return asyncHttpClient.preparePost(capsuleUrl + "/api" + readContextPath() + "/" + id + "/customfield")
