Skip to content

Instantly share code, notes, and snippets.

@Lonsdale201
Created November 11, 2024 10:30
Show Gist options
  • Save Lonsdale201/4599a4e656c54fb55fe6dc6493d5aadc to your computer and use it in GitHub Desktop.
Save Lonsdale201/4599a4e656c54fb55fe6dc6493d5aadc to your computer and use it in GitHub Desktop.
JetEngine - FluentBoards - Tasks - SQL Query
// This SQl Query For the user who is logged in, it will retrieve all tasks to which it is assigned.
// Create a new JetEngine Query, with the Query builder. Set the Query type to SQL/AI Query
// Turn on the Advanced/AI mode switcher
// in the SQL Query Area, paste the code
// In the Cast result to instance of object -- Keep stdClass
// You can use the results like jetformbuilder etc..
SELECT tasks.*
FROM {prefix}fbs_tasks AS tasks
JOIN {prefix}fbs_relations AS relations ON tasks.id = relations.object_id
WHERE relations.object_type = 'task_assignee'
AND relations.foreign_id = %current_user_id%
// type 2 with status
// change the 'open' example closed
SELECT tasks.*
FROM {prefix}fbs_tasks AS tasks
JOIN {prefix}fbs_relations AS relations ON tasks.id = relations.object_id
WHERE relations.object_type = 'task_assignee'
AND relations.foreign_id = %current_user_id%
AND tasks.status = 'open'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment