java-asana icon indicating copy to clipboard operation
java-asana copied to clipboard

Problem creating subtasks

Open jespertPT opened this issue 9 years ago • 4 comments

I have the following code. All work's fine:

Task task= client.tasks.createInWorkspace(workspaceId)
 .data("name", "TEST")
 .data("assignee", userID)
 .execute();

client.tasks.addProject(task.id)
 .data("project", projectID)
 .data("section", sectionID)
 .execute();

Now I try to create a subtask and it do nothing.

client.tasks.addSubtask(task.id)
 .data("name", "[" + nameSubtask + "]")
 .execute();

I think it reaches timeout time. I don't know if something is wrong in my code.

Could you help me?

Thank's!!

┆Issue is synchronized with this Asana task

jespertPT avatar Mar 11 '16 08:03 jespertPT

After some tests, the problem is with accents. If the subtask name contains accents (like "á"), it never creates the subtask.

How can I solve it? I need to creat tasks and subtasks with accents...

Thank you again!!

jespertPT avatar Mar 11 '16 08:03 jespertPT

I have used this and it works. I don't like it, but it works:

String subtaskName = new String("éxample".getBytes("UTF-8"))

Any other idea?

jespertPT avatar Mar 11 '16 08:03 jespertPT

Thank you. I had the same problem. Could this be fixed by changing line 153 in Client.java from: content = new ByteArrayContent("application/json", json.getBytes()); to content = new ByteArrayContent("application/json", json.getBytes("UTF-8"));

McAndze avatar Apr 20 '16 09:04 McAndze

Thanks we'll take a look at addressing this.

markchua avatar May 03 '16 02:05 markchua