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.
Related
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.
I have an incoming event stream of player interactions from an MMO. I want to construct a graph of the player's moment-to-moment interactions, continuously run queries on the activities of the past ~30-240 seconds, and update a graphical view, all in real-time.
Some more details about my particular case:
I have ~100-500 incoming events every second. These look like:
(PlayerA)->[:TAKES_ACTION]->(Event)->[:RECIPIENT]->(PlayerB)
where every event is time-stamped. Timestamps are accurate to the second. I plan on attaching every event to a node representing a timestamp, so I can restrict queries to the events attached to a set of X most recent timestamps.
I expect at any given time-frame for there to be ~1000-2000 active players.
My queries will be to group players together based on mutual interactions, to figure out which groups are currently engaged in combat with which other groups.
My main questions are:
Does Neo4j have any sort of "incremental update" functionality to efficiently update query results without re-running the entire query for every set of changes?
Does Neo4j have any sort of ability to "push" any changes to the results of a query to a client? Or would a client have to continuously poll the database?
Are there any optimisations or tricks to making a continuously repeated query as efficient as possible?
Answers
1) No. You can only execute query and get results.
2) No. Currently you can only make client -> server requests.
3) Yes.
Details
Let's get to the bottom of this one. Neo4j by default can offer you:
REST API
Transactional Cypher ednpoint
Traversal endpoint
Custom plugins
Custom unmanaged extensions
In your case you should implement unmanaged extension. This is best option to get desired functionality - develop it by yourself.
More information on extensions:
How to create unmanaged Neo4j extension?
Unmanaged extension template
Graphaware framework for extension development
In extension you can do everything you want:
Use Core API to make efficient queries for latest data
Create WebSocket endpoint for full-duplex communication channel between client and server
Implement any additional logic to format/represent your data correctly
Queries and performance
Cypher queries are compiled and cached on first execution. After that - cached query version is used. And query execution by itself is quite fast.
Recommendations:
Always use query parameters where it is possible. This allow Neo4j to efficiently reuse queries
Be smart on writing queries. Try to lower cardinality where possible.
Think about data model. Probably you can model your data in such way, when query always fetches only latest data. In you case probably relationship :LAST_EVENT, :PREVIOUS_EVENT and etc. can help.
I'm trying to use Asana events API to track changes in one of our projects, more specific task movement between sections.
Our workflow is as follows:
We have a project divided into sections.
Each section represents a
step in the process. When one step is done, the task is moved to
section below.
When a given task reaches a specific step we want to pass it to an external system. It doesn't have to be the full info - basic things + url would be enough.
My idea was to use https://asana.com/developers/api-reference/events to implement a pull-based mechanism to obtain recent changes in tasks.
My problems are:
Events API seem to generate a lot of information, but not the useful ones. Moving one single task between sections generates 3 events (2 "changed" actions, one "added" action marked as "system"). During work many tasks will be moved between many sections, but I'm interested one in one specific sections. How can I finds items moved into that section? I know that there's a
resource->text field, but it gives me something like moved from X to Y (ProjectName) which probably is a human readable message that might change in the future
According to documentation the resource key should contain task data, but the only info I see is id and name which is not enough for my case. Is it possible to get hold on tags using events API? Or any other data that would allow us to classify tasks in our system?
Can I listen for events for a specific section instead of tracking the whole project?
Ideas or suggestions are welcome. Thanks
In short:
Yes, answer below.
Yes, answer below.
Unfortunately not, sections are really tasks with a bit of extra functionality. Currently the API represents the relationship between sections and the tasks in them via the memberships field on a task and not the other way.
This should help you achieve what you are looking for, I think.
Let's say you have a project Ninja Pipeline with 2 sections Novice & Expert. Keep in mind, sections are really just tasks whose name ends with a : character with a few extra features in that tasks can belong to them.
Events "bubble up" from children to their parents; therefore, when you the Wombat task in this project form the Novice section to Expert you get 3 events. Starting from the top level going down, they are:
The Ninja Pipeline project changed.
The Wombat task changed.
A story was added to the Wombat task.
For your use case, the most interesting event is the second one about the task changing. The data you really want to know is now that the task changed what is the value of the memberships field on the task. If it is now a member of the section you are interested in, take action, otherwise ignore.
By default, many resources in the API are represented in compact form which usually only includes the id & name. Use the input/output options in order to expand objects or select specific fields you need.
In this case your best bet is to include the query parameter opt_expand=resource when polling events on the project. This should expand all of the resource objects in the payload. For events of type: "task" then if resource.memberships[0].section.id=<id_of_the_section> is true, take action, otherwise ignore.
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 do i retrieve the tasks for a project under the priority heading?
For example i have recruitment project, i want to retrieve tasks under "Interviewed" heading (priority heading)
Thanks
There isn't currently a way to only get tasks in a given section, so the only way to do this at the moment is to fetch all tasks for the project and then filter on your side. Fortunately, the API will return the tasks in the appropriate order such that all the tasks in a given section appear after it.
It's clunky, and we do intend to provide better support for sections at some point in the future, but it's not on our immediate roadmap so I'd definitely recommend this workaround for now. If the response is simply too large, one hack could be to get the ID of the "Interviewed:" task, then fetch only the IDs from the project (GET /projects/.../tasks?opt_fields=id), and then iterate over the tasks by ID. I'd only recommend this approach if the project is genuinely too big to fetch at once, though.