MS Teams Planner Task Export
To help with assembling the company reports/handover documents, we have a Python script that fetches
the current tasks from the MS Teams Planner board and exports them as a csv
, for inclusion as a
table in the document. It uses the Microsoft Graph API to access the data.
The script can be found here. It’s pretty simple to use, and for a step-by-step guide see below:
Steps
-
Open the Terminal
Open up your favourite terminal, and navigate it to where you’d like the resulting
csv
file to be saved. -
Download and Run the Script
Copy and paste the following command into your terminal, then press Enter:
Terminal window curl -O https://raw.githubusercontent.com/thoth-tech/ThothTech-Documentation-Website/refs/heads/main/public/scripts/MSTeamsPlannerExportScript.py && python MSTeamsPlannerExportScript.pyThis just downloads the Python script mentioned above, and runs it. The script doesn’t require any additional dependencies, and should work on any platform.
-
Authorize the Script
Once the script runs, it’ll show something as follows:
Terminal window --------------------Welcome to the MS Teams Planner Export Script!--------------------Please go to https://microsoft.com/devicelogin and enter this code: <Code Goes Here>Waiting for user authorization... (Will check again in 5 seconds)Simply navigate to that URL in your browser, and enter the code - this will authorize the script to read your planner board/tasks, and basic user data (to retrieve member names, etc).
-
Choose a Planner Board
Once authorized, a list of planner boards you have access to will appear, e.g:
Terminal window --------------------Fetching accessible plans/boards--------------------Here are the list of plans you can choose from:0) Reload options1) SplashKit2) OnTrack Project3) The Activity ListIf you don't see the one you are expecting, make sure you have opened that plan at least once in Teams - then choose option 0 to reload.Please select a plan to fetch data from, by the number beside it.>Just type in the number beside the board you want to export data from, and press enter.
If you don’t see the one you are expecting, make sure you have opened that plan at least once in MS Teams - then choose option 0 to reload.
Once you choose a board, it’ll fetch the task data!
Terminal window > 1You have selected 'SplashKit', which has the ID mIelcQoIgkqhbM8WaPS3sMgAEmyV--------------------Fetching tasks...--------------------Fetching more...487 tasks fetched!Here I’ve chosen the SplashKit board.
-
Choose the Export Format
Next it’ll ask which format you’d like to export as; you’ll probably want
document
for company reports. You can also useraw
mode, which will also output the task’s bucket, along with unassigned tasks - this can be useful for further analysis.Terminal window --------------------Format Selection--------------------Are we exporting the raw data, or the data needed for company documents/handovers? (raw, document)> documentHere I’ve chosen
document
mode. -
Choose Which Buckets to Export
Now you can choose which buckets to export. You can enter a comma delimited set of numbers for which buckets you would like to export data from (e.g
1,4,5
). You can also use @ and then a word to select all buckets with that word (e.g1,7,@Complete
)Enter
ALL
to export all of themTerminal window --------------------Bucket Selection--------------------Please enter a comma delimited set of numbers for which buckets you would like to export data from (e.g 1,4,5).You may also use @ and then a word to select all buckets with that word (e.g 1,7,@Complete)Enter ALL to export all of them.--------------------1) Game Dev - Backlog2) Arcade Machine - Backlog3) Complete4) Mentor Review - Olivia5) Mentor Review - Sean6) Second Peer Review7) First Peer Review8) Doing9) Usage Examples - Backlog10) Splashkit Website - Backlog11) Splashkit Expansion - Backlog12) Splashkit Online - Backlog--------------------> @Review,@CompleteYou have selected the following buckets:--------------------Mentor Review - OliviaMentor Review - SeanSecond Peer ReviewFirst Peer ReviewComplete--------------------Is this correct? (y/n)> yHere I’ve chosen a common one,
@Review,@Complete
, to export all tasks in review/complete buckets. -
Done!
Finally it’ll begin exporting! This can take some time, since it still needs to gather additional information for each task (such as attachments, etc).
Terminal window Buckets selected - we can export the data now!--------------------Exporting...----------------------------------------Finished! You can find the output at SplashKit_Tasks_2024-12-11T07-57-48.csv--------------------Once it’s finished you can find the output inside the same folder you opened the terminal in!