Skip to content

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

  1. Open the Terminal

    Open up your favourite terminal, and navigate it to where you’d like the resulting csv file to be saved.

  2. 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.py

    This just downloads the Python script mentioned above, and runs it. The script doesn’t require any additional dependencies, and should work on any platform.

  3. 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).

  4. 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 options
    1) SplashKit
    2) OnTrack Project
    3) The Activity List
    If you don't see the one you are expecting, make sure you have opened that plan at least once in Tea
    ms - 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
    > 1
    You have selected 'SplashKit', which has the ID mIelcQoIgkqhbM8WaPS3sMgAEmyV
    --------------------
    Fetching tasks...
    --------------------
    Fetching more...
    487 tasks fetched!

    Here I’ve chosen the SplashKit board.

  5. 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 use raw 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)
    > document

    Here I’ve chosen document mode.

  6. 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.g 1,7,@Complete)

    Enter ALL to export all of them

    Terminal 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 - Backlog
    2) Arcade Machine - Backlog
    3) Complete
    4) Mentor Review - Olivia
    5) Mentor Review - Sean
    6) Second Peer Review
    7) First Peer Review
    8) Doing
    9) Usage Examples - Backlog
    10) Splashkit Website - Backlog
    11) Splashkit Expansion - Backlog
    12) Splashkit Online - Backlog
    --------------------
    > @Review,@Complete
    You have selected the following buckets:
    --------------------
    Mentor Review - Olivia
    Mentor Review - Sean
    Second Peer Review
    First Peer Review
    Complete
    --------------------
    Is this correct? (y/n)
    > y

    Here I’ve chosen a common one, @Review,@Complete, to export all tasks in review/complete buckets.

  7. 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!