Get all task information via API from asana - api

i'm writing a simple application to build a task dependency tree (i declare a dependency by commenting on a task "Depend on: ") using asana API, it is indeed a simple task and should also be a simple and quick script, but i got to a bottle neck here.
From the API documentation i get that i need to:
Query the project tasks using /project//tasks
iterate trough tasks to:
get complete task information, since i'm only getting id and name.
Get task stories.
what i would like to do is a simple api call to get all this information at once, like:
/project//tasks options.expand {task, stories}. Am i missing something or this it not possible?

Complete information about tasks you can get with one request thanks to "opt_fields" option (https://asana.com/developers/documentation/getting-started/input-output-options).
Unfortunately "stories" still need another request.

No. As seen in the asana queries are tree-like structure. To get the story you require workspace_id > project_id > task_id & task_id for story. I recommend that you use a loop. Tasks of the project for getting information on the tasks and history. Upon receipt of the task id - send two requests info task & stories. Thank you, Ruslan.

Related

How to Get All Tasks from a Story Using DevOps API

I'm trying to get all Tasks from a Story with the DevOps API but I only found a relation expand command which is not that what I want.
So how can I "expand" a Story to see all Tasks?
API REQ: https://----/----/----/_apis/wit/workitems/ID?api-version=5.1
With that I only get like the name, desc, state, reason, assignedto and so on.
Check with the related REST API and Azure CLI, it seems that currently we have no easy way to get the list of Tasks that have been linked to a User Story.
You can execute the API "Work Items - Get Work Item" and get the list of work items that have linked to the specified User Story from the Response body of this API.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?$expand={$expand}&api-version=6.1-preview.3
In the list you can get the URL of each linked work item. You can get the detailed information of each work item via sending request to the URL. From the detailed information, you can get the work item type of each item.

JQL query that shows the tasks which have new comments on them

I work for a university and my group uses JIRA to maintain our technology helpdesk. We often send messages to customers and wait days to hear a response. I am looking for a filter that will show all the open tasks which are assigned to me and have a new comment from someone other than me. This way I don't have to look through all of my tasks, I can easily tell from this filter, whether any of my tickets now require a response from me.
So far I have this search:
assignee = currentUser() AND status != Done AND
updatedDate > startOfDay(-1d) AND updatedDate < endOfDay(-0d)
It doesn't look like Jira provides a way to access number of comments, last comment date, etc. The closest thing I could find in their reference was Comment which only checks the text of a comment.
Possible Alternatives
Add yourself as a watcher of the Jira issues and setup email notifications. This is what I do to manage my Jira issues. I setup a Jira folder in my email and an automated filter to move all Jira notifications into it. Then I just look through that folder multiple times per day. The downside is you'll keep more notifications than you actually need or care about.
Use Jira's REST API. If you or someone at your school has some programming knowledge, you could probably use the Jira API. Potential solution:
Use the search endpoint to get a list of issues. You can pass JQL to the API to filter the issues.
Use the get issue endpoint to get the details of each issue returned from the search. Within those details are all the comments on the issue, including the time the comment was posted.

How to consolidate API calls for the ASANA API

I'm a freelance web dev and I work with a lot of clients across many different workspaces in Asana. Not being able to get a consolidated view makes this a tedious and difficult thing to manage, so I'm putting together my own little utility to help me get a 'superview' of tasks assigned to me in order of the due date. In order to make this easier for me to scan, I need to have the project name next to the task details.
The easiest way, in my mind, would be a single API call for all tasks assigned to me and request the project name, task name, task id, due date, and workspace name all at once.
The API doesn't seem to allow this consolidated type of request, however, so instead, the workflow goes something like this;
API call to get all my workspaces
Loop through the workspaces, making an API call for each to get all tasks
Use PHP to sort those tasks accordingly
Loop through those tasks making an API call for the first instance of each project in order to get the project name (I cache the data as I
go so that I'm only making a call once per project)
The issue I'm getting is a 500 error when I start making API calls to get the project details. I doubt I'm hitting the 100 call per minute limit, but I'm still getting the errors none the less. In light of this, I'm looking for a way to make a consolidated call that contains all the data I need, but I can't seem to figure it out.
Anyone have some guidance on this?
Good news! We actually do support Input/Output options that allow you to specify which fields you want, including nested fields. So, while you still need to make separate calls for each workspace, you can do something like this:
workspaces = GET /workspaces
for id in workspaces
tasks = GET /workspaces/:id/tasks?assignee=me&opt_fields=name,due_on,projects.name
(If you're only interested in incomplete tasks, you can add &completed_since=now - or if you want incomplete and recently completed tasks, &completed_since=... with the timestamp you want to exclude any tasks that were completed before)
Additionally, 500 is not the code we send for rate limiting - it's likely an issue with the request itself. How are you requesting the project details?

Asana Task Logs - How to get it?

Asana lack of reporting is bugging my team, so we are trying to use the asana's API to generate at least basic reporting.
Is it possible to get the task logs that are shown in the task details?
In the task details I can see this:
User created task.Mar 25
User added to proj1.Mar 25
User moved from proj1 to label2 (proj1).Mar 25
User assigned to UserX.9:22am
How can I get it?
As mentioned in the documentation you can get what we call the "stories" for an object using GET /tasks/:id/stories. Note that the creation task we display in the app is actually displayed from the task data, and not a story in its own right: you can determine this by looking at the value of created_at for the task itself using GET /tasks/:id?opt_fields=created_at, for instance.

Rally: Pull stories counts by schedule state for a release?

I'm trying to pull from the API of story counts for the latest release, broken down by schedule state. There's a report that does that currently, but I don't see any exposed method in the API. Does anyone know if that's possible to obtain?
You should be able to do a query for each schedule state, and grab TotalResultCount from the body of the response. For example:
https://rally1.rallydev.com/slm/webservice/1.31/hierarchicalrequirement.js?query=(ScheduleState = "Defined")
https://rally1.rallydev.com/slm/webservice/1.31/hierarchicalrequirement.js?query=(ScheduleState = "In-Progress")
and so on. Since there are only four "built-in" schedule states, plus an optional one before Defined and an optional one after Accepted, it's at most 6 requests.
You can further filter down Alan's examples above with some release information as well by changing the query parameter:
query=((ScheduleState = Defined) AND (Release.Name = "My Release"))
Are you writing an app using the App SDK or using one of our other REST toolkits (ruby, .net, python)? You may be able to find some better code examples here:
http://developer.rallydev.com
You might also try the Batch Query approach that allows you to just return the size of the query instead of counting the results. See the
"Getting the Size of a Collection" example of the api doc:
https://rally1.rallydev.com/slm/doc/webservice/batch.jsp#example8