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