Commit bef46c6a7fdfe30711601dc2b75ae6aa59578a35

Authored by Administrator
1 parent 029e74a7

TT

@@ -14,7 +14,10 @@ import org.apache.http.auth.AuthenticationException; @@ -14,7 +14,10 @@ import org.apache.http.auth.AuthenticationException;
14 import pl.com.it_crowd.youtrack.api.rest.Issues; 14 import pl.com.it_crowd.youtrack.api.rest.Issues;
15 15
16 import javax.xml.bind.JAXBException; 16 import javax.xml.bind.JAXBException;
  17 +import java.io.BufferedReader;
17 import java.io.IOException; 18 import java.io.IOException;
  19 +import java.io.InputStreamReader;
  20 +import java.net.MalformedURLException;
18 import java.net.URL; 21 import java.net.URL;
19 import java.security.GeneralSecurityException; 22 import java.security.GeneralSecurityException;
20 import java.util.ArrayList; 23 import java.util.ArrayList;
@@ -89,4 +92,19 @@ public class YoutrackAPI { @@ -89,4 +92,19 @@ public class YoutrackAPI {
89 } 92 }
90 return result; 93 return result;
91 } 94 }
92 -} 95 +
  96 + public void setTotalIssueDuration(String issueSignature, Long issueTotalDuration){
  97 + String url = serviceLocation + "/rest/issue/" + issueSignature + "/execute";
  98 + ArrayList<NameValuePair> requestParameters = new ArrayList<NameValuePair>();
  99 + requestParameters.add(new NameValuePair("command", "Real completion time " + issueTotalDuration));
  100 + try {
  101 + WebRequest request = new WebRequest(new URL(url), HttpMethod.POST);
  102 + request.setRequestParameters(requestParameters);
  103 + webClient.getPage(request);
  104 + } catch (MalformedURLException e) {
  105 + e.printStackTrace();
  106 + } catch (IOException e) {
  107 + e.printStackTrace();
  108 + }
  109 + }
  110 +}
Please register or login to post a comment