how to mark a task as archived with the asana api? - asana

If i just mark a task as completed, it still gets returned each time I query for tasks, forcing me to process the same task each time I call the tasks api. I have tried searching the documentation, to no avail.
If I can mark a task as archived, that will essentially mean 'processed' from my apps perspective and the size/frequency of my asana api requests will be controlled.
Thanks!

There currently isn't a way to filter out archived tasks in the API. A workaround might be to record the IDs of processed tasks locally?

Related

MS Graph API / Planner - Query all Task Details for a Plan

I'm trying to get all the "Task Details" for a give "Plan".
I can get the "Plan", "Buckets", "Tasks" using {plan-id}
https://graph.microsoft.com/beta/planner/plans/eAk8BBGJfU6e2_SQexZPtxxxxxx
https://graph.microsoft.com/beta/planner/plans/eAk8BBGJfU6e2_SQexZPtxxxxxx/buckets
https://graph.microsoft.com/beta/planner/plans/eAk8BBGJfU6e2_SQexZPtxxxxxx/tasks
But the "Task Details" uses {task-id}
https://graph.microsoft.com/beta/planner/tasks/{task-id}/details
Is there a way to write a single query that will return all the task details for all tasks in the plan?
Cheers, Mike
You can now expand details when reading tasks in plan. /plans/id/tasks?$expand=details
Outdated previous reply:
We don't currently have a way to get this information in a single
request right now. The standard way is to get the tasks, then make
separate calls for the details of the tasks that you are interested
in. We're evaluating whether this is something that should be added.
If you don't mind, can you explain your high-level scenario and what
kind of information you are interested in task details? That would
provide valuable information for the decision-making process.
I'm using batching for similar thing. You can get the list of tasks and then launch a number of batched queries to get details of those tasks (note that 20 is currently the max number of items in the batch query). Also, you can run these queries in parallel if you want to. Using these optimizations, you should be able to get all data for a plan of something like 100 tasks in milliseconds.
#Tarkan - I'm using that for synchronization with a third-party (our) application.

Check of Microsoft 365 Planner task was updated, if true then feedback with microsoft graph API

I am searching for a solution to get a automated feedback, when a planner task is changed.
Why? We use a planner to assign task to a person in the team. This person can change the tasks details. I only get a feedback if the person finishes the task.
But not if the person changes the other details. The team is big,so I can‘t check every assigned task.
Powerautomate helps not much in this.
I just started using Microsoft Graph and I prefere scipting over using powerautomate.
My question:
Is there an Object that looks at the changes in a specific planner task globally or do I have to check each detail in the task?
And can I run this hourly every day until the task is closed?
We're looking into setting up web hooks, which I think will be the way to solve this scenario. However, before we have that, I don't think there is much to support to achieve this. Since everything is in the same plan, you can probably remember the etags of the tasks, and see if they have changed, if they have, then send the reports about them. But the etags are going to be updated for any change, even if the change isn't something you care about (e.g. just moving the task around in the board). Also, task and task details have separate etags, the details can be updated without the task etag changing, so this isn't a simple solution.

How to know if a Neo4j background job completed successfully?

I'm using Neo4j. For large data imports from external csvs, parquets, etc. there is a very handful command for "fire and forget", the apoc.periodic.submit. There is also the apoc.periodic.list that list the background jobs.
During the execution of the background job it appears in the output of apoc.periodic.list. But after it finishes, either by an error or by a successful execution, it will disappear from this list without any feedback from the completion status.
Is there a general way to check if a background job finish status? Is there a more suitable API for my purposes?
If there is a way to directly check error status on the fire&forget routines, I don't see it in the documentation (they are fire&forget, so it comes with the territory?)
Ideas
don't background the query itself, background a process/task that waits for a blocking Cypher execution to finish and capture the error code...
check for success instead of failure? (if it didn't succeed you know it failed right?), this may be evident based on what the Cypher does, or you could add a graph content update for this purpose. E.g. Update property on a NODE with last_updated. Do that last so that if the cypher fails, the property is not updated
You could enable query log and then check there to see what happened, most likely this query has a unique signature and the last execution could be found easily in the log (with status/error code)

Get info about latest created and completed tasks in asana

I need to maintain list if all user's incomplete tasks with asana API.
Right now, the best solution I came up with is polling asana for every X minutes and use /tasks with completed_since filter. However this is inefficient, since I have to perform exactly one call for every workspace.
The next thing I tried was looking into /events API, but events are generated only for projects and tasks. I got about 25 projects so it isn't the best solution either.
Is there any way I could check for updates efficiently?
Thanks.
Actually, "exactly one call per workspace" is as good as it's gonna get - we scope each request to a workspace (in fact, it's likely that in the future each API call will need to be explicitly scoped to a workspace). It's a hard IP boundary, so basically we never "mix" data from different workspaces (except for certain exceptions, like "listing the workspaces I'm in").
If you're specifically only looking for updates to tasks, you could also use modified_since.

How can I know which tasks are running in the background?

I'm trying to implement a seemingly common feature in my app: to upload files in the background. I run such tasks by calling -[UIApplication beginBackgroundTaskWithExpirationHandler:], so those tasks are each identified by a UIBackgroundTaskIdentifier.
Please take a look at the diagram below. Orange boxes are problem points for which I can't seem to find any answer.
Here are the questions for which I seek guidance:
Is it possible to get a list of running tasks that same app initiated in a previous session?
Is it possible to associate some kind of meta data, such as a URL string, with a background task, so we can know which task is uploading which file?
Are you using NSURLConnection or NSURLSession?
If NSURLSession, you can use getTasksWithCompletionHandler. You can also use a background NSURLSessionConfiguration, rather than relying on beginBackgroundTaskWithExpirationHandler. And it terms of keeping track of the requests, you can retrieve the originalRequest from the task (and retrieve the URL from that), or update your model with the taskIdentifier for the NSURLSessionTask, and cross reference requests in your own model that way.

Resources