Update Asana Task

Hello,

I’m trying to update a asana task from ServiceNow Rest API but receiving the following error.

{“errors”:[{“message”:“task: Not a Long: task_gid”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: Errors”}]}

Welcome, @Srujan_Chilumula,

I moved this to Developers & API where you will surely get a thorough answer!

Hi @Srujan_Chilumula ,

Welcome to the forum! Please see documentation for this endpoint here. You need to pass the task_gid in the URL and not the content body. That error is telling you that you’re passing the literal string task_gid instead of passing the actual task_gid itself as a string (e.g. "1122334455").

3 Likes

Actually although it’s currently all numeric, it needs to be passed as a string, not a number.

3 Likes

Thanks for the correction; updated previous post for accuracy.

2 Likes

So the task_gid means the task id, Right?

image

@Srujan_Chilumula - Assuming you have the task open on your screen (probably inside of a project), that’s correct. In that URL, the first long gid is for the project and the second is for the task.

1 Like

I successfully updated the task in Asana from ServiceNow. Now, I am attempting to update the task comments using the following content:

{
“data”: {
“notes”: “Mittens likes the stuff from Humboldt.”
}
}

However, instead of updating the comments, it is updating the task description. Can you please let me know what the query parameter is for comments in Asana?

@Srujan_Chilumula - this is the documentation for comments (create and update are slightly different but both documented). Generally speaking, the dev docs are a really good place to check first (you can search them for keywords like “comment”) since you can also test your calls in the web-based explorer before building your calls in your app.

1 Like