How to know if a task is a template?

Hi everyone,

We just found that, task templates in a project are returned using the “GET /tasks” endpoint.
But, there’s no field telling us if that task is a template.

So, we show to our users tasks that are templates, but if we need to remove them from resultset, we don’t know how.

The only hint is that the “name” of the task has a prefix: “[Converted to template] (original name)”.

  1. Why are they returned, and can we apply a filter to not get them in return?
  2. Can we add a filter to prevent them to be returned?
  3. Is there a hidden field that I can add to “opt_fields” that tells me that that task is a template, to allow me to remove it from my resultset, or to show my user that task x is a template?

Thank you!

The following task IS a template.

{
	"data": {
		"gid": "1203210768439040",
		"assignee": null,
		"assignee_status": "upcoming",
		"completed": true,
		"completed_at": "2022-10-20T19:06:15.442Z",
		"created_at": "2022-10-20T19:05:58.975Z",
		"custom_fields": [...],
		"due_at": null,
		"due_on": null,
		"followers": [...],
		"hearted": false,
		"hearts": [],
		"liked": false,
		"likes": [],
		"memberships": [...],
		"modified_at": "2022-10-20T19:06:15.729Z",
		"name": "[Converted to template] ceci est un template",
		"notes": "",
		"num_hearts": 0,
		"num_likes": 0,
		"parent": null,
		"permalink_url": "...",
		"projects": [...],
		"resource_type": "task",
		"start_at": null,
		"start_on": null,
		"tags": [],
		"resource_subtype": "default_task",
		"workspace": {...}
	}
}

@Frederic_Malenfant,

I believe these are not task templates. These are tasks, now completed, which were previously incomplete tasks upon which the Convert to task template menu item function was performed. Asana marks them complete with a special icon after creating the task template (which is a separate object).

It would be nice if there was some indicator, as you suggest, but I wanted to clarify the above, which I believe to be the case.

Larry

1 Like

Oh, you are right, It’s the original task that was converted to a template, and marked as completed.

Now, in the UI, I see them differently.
Normal completed task are marked green, but completed “converted to templates” are marked with round dots.
image

It would be nice if, from the API, we can know the difference between both.

2 Likes

Exactly, and agreed!

1 Like