Hi! I think you get the compact record of the task. Not sure actually if you can do that on the worskpace and get all tasks. I believe you should use the project id when using that request.
client.tasks.findAll(, {params: params}).then(res => console.log(res))
And it he params you should enter opt_expand: ‘custom_fields,notes,assignee’ ← and so on to list the key values you want from the task. Because the compact response only contains text, name, and gid.
But if you really want to search the api and not use your own filters and get more lightweight reponse i would create my own function and use the search api.
I did a quick code example if you want to create your own function using requestjs. You could use needle or something instead. Its a bit dirty here but should work if you just replace the values. =)
const request = require(‘request’);
// Your token
const token = ‘abcd1234’;
// The function with the searsh string
const findNewTask = (text, projectId, customFieldId) => {
const searchString = https://app.asana.com/api/1.0/workspaces/522601424914270/tasks/search?projects.any=${projectId}&custom_fields.${customFieldId}.value=${encodeURI( text )}&opt_fields=name,tags,completed,assignee,notes,custom_fields;
Yeah i get that, but the question was if there was any way using Asana’s NodeJS api, I’ve mentioned that endpoint’s documentation in my question, and that is my current setting. I was really just hoping for a Yes/No answer, since there is no documentation for it.
I guess the answer is No. Despite the helpful answers with questions.
Hi @dfc, I believe you’re looking for the client.tasks.searchInWorkspace() method, which hits the /workspaces/{workspace_gid}/tasks/search endpoint you linked to in the docs.