From bef46c6a7fdfe30711601dc2b75ae6aa59578a35 Mon Sep 17 00:00:00 2001 From: Krzysztof Modzelewski Date: Tue, 10 Apr 2012 13:14:49 +0000 Subject: [PATCH] TT --- src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java b/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java index ef80051..385a76c 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java @@ -14,7 +14,10 @@ import org.apache.http.auth.AuthenticationException; import pl.com.it_crowd.youtrack.api.rest.Issues; import javax.xml.bind.JAXBException; +import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStreamReader; +import java.net.MalformedURLException; import java.net.URL; import java.security.GeneralSecurityException; import java.util.ArrayList; @@ -89,4 +92,19 @@ public class YoutrackAPI { } return result; } -} + + public void setTotalIssueDuration(String issueSignature, Long issueTotalDuration){ + String url = serviceLocation + "/rest/issue/" + issueSignature + "/execute"; + ArrayList requestParameters = new ArrayList(); + requestParameters.add(new NameValuePair("command", "Real completion time " + issueTotalDuration)); + try { + WebRequest request = new WebRequest(new URL(url), HttpMethod.POST); + request.setRequestParameters(requestParameters); + webClient.getPage(request); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file -- libgit2 0.24.0