final String body;
final String due = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
final String bodyString = "{\"version\":{\"name\":\"%s\",\"status\":\"closed\",\"due_date\":\"%s\"}}";
body = String.format(bodyString, version.getName(), due);
final HTTPRequest req = this.createRequest("/versions/" + version.getId() + ".json");
req.header(WSConstants.HEADER_CONTENT_TYPE, Redmine.APPLICATION_JSON);
final HttpResponse put = req.body(body).put();
if (!WS.isStatusOK(put)) {
this.log.error(WS.getResponseAsString(put));
throw new RedmineException(Redmine.STATUS_CHANGE_FAILED);
}