Fork me on GitHub

Project Notes

#296 Backup

How to script a simple Pivotal Tracker backup with python and the RESTful API

Notes

Pivotal Tracker does not have a built-in feature for direct project backups, but you can use its API to fetch and store project data.

See pt_backup.py for an example of a script to perform such a backup. It covers:

  • epics
  • stories
  • story activity

It currently doesn’t include attachment downloads.

Running the Script

Install the required packages using pip:

pip install -r requirements.txt

The script expects the Pivotal Tracker API token and project ID to be provided as environment variables:

export PIVOTAL_TRACKER_API_TOKEN='your_api_token_here'
export PIVOTAL_TRACKER_PROJECT_ID='your_project_id_here'

To run the script:

$ PIVOTAL_TRACKER_API_TOKEN=my-token PIVOTAL_TRACKER_PROJECT_ID=my-id ./pt_backup.py /MyBackups
Data saved to /MyBackups/stories_backup.json
Data saved to /MyBackups/epics_backup.json
Data saved to /MyBackups/activities_backup.json

Credits and References

About LCK#296 Toolspython

This page is a web-friendly rendering of my project notes shared in the LittleCodingKata GitHub repository.

Project Source on GitHub Return to the LittleCodingKata Catalog
About LittleCodingKata

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.

Follow the Blog follow projects and notes as they are published in your favourite feed reader