Get info about latest created and completed tasks in asana - 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.

Related

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.

Suggestion for trigger that sends email if threshold is broken

This is quite a broad question but ill try and summarise it as best I can.
I have an MVC front end which displays/allows processing of records which are classed as outstanding. I also have a scheduled console app which runs nightly and attempts to resolve each of these records using some logic I wrote.
I have a new requirement, which is to have an email sent every time the total number of outstanding records exceeds a certain amount, this amount needs to be configurable.
The table will contain every record with a flag to say if they have been resolved or not, so I will need to count the outstanding's then fire an email to notify if the threshold is broken.
I initially thought about adding a SQL Server trigger on insert however I soon realised that if no more records were added for a few days but the total number stayed above the threshold because nobody resolved them, then no further email would be sent.
I need the email to send every day on a schedule independently of insert/update.
So now I'm thinking possibly a SQL Server job, or an SSIS package or even a service which runs, but I'm aware this threshold number needs to be configurable.
So what would be the quickest simplest solution to my requirements, I'm open to any suggestion as long as it ticks all the boxes.
Given that the OP already has a console app running on a schedule, the most logical choice would be to simply add this check to the console app along with the email sending logic. It will be much easier to send emails that way, anyways, especially if you employ something like Postal, which will let you use MVC-style views to create your emails.
An SQL Server scheduled job seems to me to be the simplest way to go.
you can add a table to your database that will hold the threshold number and read it's value from there.
In many cases a GeneralParams table is a good thing to have anyway.
The other option you mentioned (windows service) is also configurable in many ways: you can use a GeneralParams table, or the App.Config file of the service (but you will have to restart it every time you change the app.config), or even a simple text file. anything goes. the downside is that it's outside of your sql server, but the upside is that it is probably easier to send emails from.

Using Asana events API for task monitoring

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.

TFS 2013: How to Create Alerts for Unfinished Work Items when a Sprint Ends

Is there a way to set up custom alerts on TFS? I already use the web interface to create alerts, but I need to create custom ones that are not based on work item fields only, but also on the current and past iterations. I know that Power Tools used to have an Alert Explorer in previous versions of Visual Studio, but I don't know if it would have supported what I am trying to do.
Essentially, this is what I need:
An alert that notifies users of unfinished work items assigned to them when the current iteration (sprint in my case) ends.
I know some of you might be concerned about TFS not knowing what the current sprint is, but I have used this workaround http://intellitect.com/transitioning-between-sprintsiterations-with-tfs/ so I don't believe it's an issue.
I know I could simply query for unfinished items and move them to another iteration (sprint) in Excel, but we are trying to get into the habit of getting everyone to finish their work on time, and if not, as quickly as possible, and the notifications would go a long way in helping with that.
Would there even be a way to do this via the TFS API or through the TeamFoundation PowerShell modules? I have searched extensively but I can't seem to find an answer to this question. Any help even with a work-around solution would be appreciated.
If you are trying to get people into the habit of updating their work items then this will cause you more issue than it fixes. They are not doing it because they do not see the value.
However you could write a TfsJob that sends the emails. It would need to be Scheduled job that checks to see if there is outstanding work...
This should get you started: http://blogs.msdn.com/b/chrisid/archive/2010/02/15/introducing-the-tfs-background-job-agent-and-service.aspx
However what you have is a people problem that cant be solved by tooling.
what I like is getting a job thing, whether a SQL server one or a windows service, running, then manipulate workitems by myself.

How do i retrieve the tasks for a project under the priority heading?

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.

Resources