-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't move a task to another project/section? #8
Comments
@oscarclivio thanks for bringing this up. Sorry for the delayed response, we're full of vacations in December @PotHix I've tried and moving through setting the |
Are you sure? Via task update? That shouldn't work in the current version.
Yes, that is in the roadmap, preferably without needing a specific endpoint for the move (but needs further exploration). It will certainly get in at some point, we just don't have an ETA yet. |
Update: an internal ticket has been created for this, but we can't share a deadline for this. We'll post updates here when we have them. |
Any updates on this? Since the |
Sorry for my absence of response, it looks like I forgot I had written this issue. It looks like the sync API is deactivated now. So any updates on this? It is a key point of my personal task management. |
My current workaround (not beautiful, but after a lot of frustrating testing I came to this) for moving a task to a new parent task: ...
req = requests.post('https://api.todoist.com/sync/v9/sync', headers={'Authorization': f"Bearer {TODOIST_APITOKEN}", 'Content-Type': 'application/x-www-form-urlencoded'}, data={'commands': json.dumps([{'type': 'item_move', 'uuid': str(uuid.uuid4()), 'args': {'id': str(previousTask.id), 'parent_id': str(tasks[0].id)}}])})```
if req.status_code != 200:
print(requests.Response.text)
... |
Yes, the Python package is deprecated for a while and will not be updated for v9.
The Sync API is not deactivated yet. We're going to deprecate the version 8 of the Sync API, but the version 9 is already released and has the same feature. We know it's a bummer that we still don't have this implemented in the REST API yet, and I hope to be able to prioritize it soon. |
Hm, same problem here - v8 depreciated and no python library for v9 ... |
Hi, I am not pro-programmer - could you help to use your code to move task to another project? Thanks. |
import requests
import uuid
import json
TODOIST_APITOKEN = None # put your token here
task = None # get your task the way you do
project = None # get your project the way you do
req = requests.post('https://api.todoist.com/sync/v9/sync', headers={'Authorization': f"Bearer {TODOIST_APITOKEN}", 'Content-Type': 'application/x-www-form-urlencoded'}, data={'commands': json.dumps([{'type': 'item_move', 'uuid': str(uuid.uuid4()), 'args': {'id': str(task.id), 'project_id': str(project.id)}}])})```
if req.status_code != 200:
print(requests.Response.text) That should do the trick. Note that this is untested. |
A simpler approach: from uuid import uuid4
TOKEN = "xxx"
def move_task(task_id: str, project_id: str) -> bool:
body = {
"commands": [
{
"type": "item_move",
"args": {"id": task_id, "project_id": project_id},
"uuid": uuid4().hex,
},
],
}
response = requests.post(
"https://api.todoist.com/sync/v9/sync",
headers={"Authorization": f"Bearer {TOKEN}"},
json=body,
)
return response.ok |
@ramonvg |
Not the prettiest solution but with the tools available in Todoist REST API (not tested):
|
@Pa7rickStar |
@jankratochvilcz any update on REST API to move a task between projects? If not, consider this me registering my interest ;) |
Well there's 30 min of debugging i'll never get back... turns out that it's not supported, nor is there an error raised/returned to indicate as much :(. Thanks to @ramonvg for the workaround that ... should not have been needed. |
I also need this feature to move a task in another section. Why is this not supported? |
Moving a batch of tasks from inbox to a different project was literally the first thing I tried to do with the API. Is it really not possible? That seems really surprising to me. |
Possible, just have to use the RPC sync API, not REST api. See
https://github.com/nstielau/todo5/blob/0dbbec85862cb9b7bd31d84bb628ca82f45f1413/src/components/InboxReviewComponent.vue#L76
…On Mon, Oct 7, 2024 at 4:22 PM Dylan Kinnett ***@***.***> wrote:
Moving a batch of tasks from inbox to a different project was literally
the first thing I tried to do with the API. Is it really not possible? That
seems really surprising to me.
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHKOZ4SOZXOHP6AYOLKF3Z2MJSJAVCNFSM6AAAAABPQ6T6A6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJYGEZTAOBUGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
For anything involving batches, the sync API is a more efficient/better choice anyways. I wish the Doist team(s) would update their dev docs to make it clear that there are two APIs and that they are not 1:1 feature wise. I do not know if they changed course on deprecating the sync API or not but if that's still the plan, reflecting that in the dev docs would also be a welcome improvement. |
Unless I am misunderstanding the basic principle of a REST API, I do not see any function to move a task to another project or section either in the documentation or the code.
Did I miss this method somewhere? Or can this be implemented?
The text was updated successfully, but these errors were encountered: