Skip to content
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

Section filters return no results #11

Closed
darthmachina opened this issue Aug 31, 2020 · 9 comments
Closed

Section filters return no results #11

darthmachina opened this issue Aug 31, 2020 · 9 comments
Labels
🐛 bug Something isn't working

Comments

@darthmachina
Copy link

  1. Create a project that includes a section (i.e. 'Test')
  2. Add a task under that section
  3. Create a todoist code block in Obsidian that uses the filter /Test
  4. No results will be returned for that block in Preview mode

Creating the same filter within Todoist itself will return the task created above.

@jamiebrynes7 jamiebrynes7 added the 🐛 bug Something isn't working label Sep 1, 2020
@jamiebrynes7
Copy link
Owner

As a quick update for this issue, the Todoist API returns a 501 response code if you include a section filter in the REST API endpoint which this plugin uses (/rest/v1/tasks). 501 means that its not implemented on the Todoist backend. 😬 (Related to #18 as to why you aren't seeing anything)

I've asked them if this is planned to be implemented in the future, but it may be the case that for now this won't be possible.

A long term solution would be to migrate to the Sync API which opens up some other interesting possibilities, but also would require a fair bit of work.

In the meantime, I'll add a note to the README that section filters are currently unsupported.

@darthmachina
Copy link
Author

Well, crap. Spent a bit of time migrating all of my Todoist projects to using sections for Kanban vs labels.

I was trying to decide where my project tasks would sit, might just have to do that in Obsidian directly instead of through this. I tend to mix tasks and notes, though, so that was probably the more likely route. My main use case for this plugin is all of my repeating tasks anyway, so this plugin already saves me a ton of work.

@jamiebrynes7
Copy link
Owner

For what its worth, I do plan to looking into using the Sync API in the future, but it requires more bookkeeping for the plugin so the REST API was the path of least resistence to get started.

So.. watch this space 😉

This was referenced Sep 12, 2020
@thammawat-s
Copy link

Now this works fine. FYI

$ curl -X GET
https://api.todoist.com/rest/v1/tasks
-H "Authorization: Bearer $token"

@jamiebrynes7
Copy link
Owner

I'm still getting 501: Unsupported filter keyword when attempting to use the section filters, I wonder if it needs to be escaped differently 😕

@thammawat-s how did you manage to get section filters working?

@thammawat-s
Copy link

thammawat-s commented Mar 22, 2021

sorry my bad. I still get the same 501: Unsupported filter keyword. :(

Edit: I asked Todoist support, they told me this is not supported yet, and will be implemented soon.

@thammawat-s
Copy link

Update. Tech support replied me, now these should work. Thanks to Omar from Todoist.

query by section_id:
GET https://api.todoist.com/rest/v1/tasks?section_id=12345

Or filter on the section name using /sectionname:
GET https://api.todoist.com/rest/v1/tasks?filter=/mysection

@darthmachina
Copy link
Author

I can confirm that filters using sections now works in the plugin, so this bug can be closed.

@jamiebrynes7
Copy link
Owner

That's awesome! Thanks for following up all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants