how to see all the tasks, more than 40 for report page, from multiple pages with a label, This to have a complete report to export in excel
👋Hi, @Nicola Nardone !
Welcome to Atlassian Community!
Could you provide more details about what you would like to export?
Hey @Nicola Nardone ,
I'm guessing you're referring to task report macro here. The macro supports filtering by labels , so I guess you could use that.
As for 'pagination' it does have that limit of 40 per page (max) and you cannot extend that.
Maybe for true Excel export of all site tasks, you could try using REST API. 🤔The GET /wiki/rest/api/inlinetasks/search (v1) or GET /wiki/rest/v2/tasks (v2) endpoints allow you to programmatically retrieve all tasks, which can then be converted into a CSV or Excel file.
GET /wiki/rest/api/inlinetasks/search
GET /wiki/rest/v2/tasks
Cheers,Tobi
Hi Nicola, I’m afraid 40 is as high as the task report goes. The setting only offers 10, 20 or 40 per page, and the request to raise it (CONFCLOUD-41565) is still waiting for votes. If you need everything in Excel, the API Tomislav mentioned is the way to go, and you can still filter by label. First, search for the pages with your label using CQL, something like label = “your-label” and type = page, and note down their page IDs. Then ask the tasks API for the open tasks on those pages (GET /wiki/api/v2/tasks with status=incomplete and a page-id for each page). Each task comes back with its page, due date, status and assignee, ready to go into a spreadsheet. One catch is that the assignee comes back as an account ID rather than a name, so you’ll need to look each person up once.
Hi Nicola,
One detail to add to Tomislav’s and Kitefold’s API suggestions: you need to paginate the API results too, otherwise the Excel export may still contain only part of your tasks.
For one of the matching page IDs, an initial request could be:
GET /wiki/api/v2/tasks?page-id=123456&limit=100
Replace 123456 with the actual page ID. Collect the response’s results, then follow the URL marked rel="next" in the Link response header. Continue until there is no next link, combining the results before converting them to CSV. Repeat for the other matching pages. Atlassian documents this pagination behaviour here.
123456
results
rel="next"
Link
Also, if “complete report” means both completed and outstanding tasks, leave out the status=incomplete filter suggested above. Use it only when you want outstanding tasks.
status=incomplete
The Get tasks reference confirms the endpoint and filters. Results are limited to tasks the authenticated user can view, so use an account with access to all the pages included in your report.
Two options, depending on whether you want to avoid the API:
1. No code: several Task Report macros on one page
The 40 limit applies per Task Report macro, so you can add several macros on one page, each with a narrower filter:
As long as each macro returns 40 or fewer tasks, the page shows all of them together. For Excel, copy each table into a sheet.
2. A small script that does it all in one go
Building on what Tobi, Kitefold and Sergey described: it finds the pages with your label, gets all their tasks (with pagination, so no 40 limit), replaces account IDs with names, and writes a CSV that opens directly in Excel.
python
import csv, html, re, requests SITE = "https://your-site.atlassian.net" # no trailing slash EMAIL = "you@example.com" API_TOKEN = "your-api-token" # id.atlassian.com > Security > API tokens LABEL = "your-label" ONLY_OPEN = False # True = only incomplete tasks OUTPUT = "confluence_tasks.csv" s = requests.Session() s.auth = (EMAIL, API_TOKEN) s.headers["Accept"] = "application/json" def get_json(url, params=None): r = s.get(url, params=params) r.raise_for_status() return r.json() def next_url(data): nxt = data.get("_links", {}).get("next") if not nxt: return None return SITE + (nxt if nxt.startswith("/wiki") else "/wiki" + nxt) def labelled_pages(): url = f"{SITE}/wiki/rest/api/search" params = {"cql": f'label = "{LABEL}" and type = page', "limit": 100} while url: data = get_json(url, params) for item in data.get("results", []): c = item.get("content", {}) yield c.get("id"), c.get("title") url, params = next_url(data), None def tasks_for_page(page_id): url = f"{SITE}/wiki/api/v2/tasks" params = {"page-id": page_id, "limit": 250, "body-format": "storage"} if ONLY_OPEN: params["status"] = "incomplete" while url: data = get_json(url, params) yield from data.get("results", []) url, params = next_url(data), None names = {} def user_name(account_id): if not account_id: return "" if account_id not in names: try: u = get_json(f"{SITE}/wiki/rest/api/user", {"accountId": account_id}) names[account_id] = u.get("displayName") or account_id except requests.HTTPError: names[account_id] = account_id return names[account_id] def task_text(t): raw = (t.get("body") or {}).get("storage", {}).get("value", "") return html.unescape(re.sub(r"<[^>]+>", " ", raw)).strip() with open(OUTPUT, "w", newline="", encoding="utf-8-sig") as f: # utf-8-sig opens cleanly in Excel w = csv.writer(f) w.writerow(["Page", "Page link", "Task", "Status", "Assignee", "Due", "Created by", "Created"]) for page_id, title in labelled_pages(): for t in tasks_for_page(page_id): w.writerow([title, f"{SITE}/wiki/pages/viewpage.action?pageId={page_id}", task_text(t), t.get("status", ""), user_name(t.get("assignedTo")), (t.get("dueAt") or "")[:10], user_name(t.get("createdBy")), (t.get("createdAt") or "")[:10]]) print("Done:", OUTPUT)
Fill in the values at the top, run pip install requests, then python script.py. It only returns tasks on pages your account can view, as Sergey noted.
pip install requests
python script.py
Hope this helps!
It looks like you're new here. Sign in or register to get started.