Merge https://github.com/jk1/intellij-community
[idea/community.git] / plugins / tasks / tasks-core / src / com / intellij / tasks / youtrack / YouTrackRepository.java
index 992c96809dc0b07d85df763ee80b5579cbed89c0..404e76ca7bba885e3535f58d05b98e7226e64f39 100644 (file)
@@ -352,7 +352,8 @@ public class YouTrackRepository extends BaseRepositoryImpl {
   @Override
   public void updateTimeSpent(@NotNull LocalTask task, @NotNull String timeSpent, @NotNull String comment) throws Exception {
     checkVersion();
-    final HttpMethod method = doREST("/rest/issue/execute/" + task.getId() + "?command=work+Today+" + timeSpent.replaceAll(" ", "+") + "+" + comment, true);
+    String command = encodeUrl(String.format("work Today %s %s", timeSpent, comment));
+    final HttpMethod method = doREST("/rest/issue/execute/" + task.getId() + "?command=" + command, true);
     try {
       if (method.getStatusCode() != 200) {
         InputStream stream = method.getResponseBodyAsStream();