|
Project Information
|
Python APIs for Pivotal Trackerpytracker is a simple Python API that wraps the Pivotal Tracker REST APIs. The API ships with an example that updates a Google Calendar with release dates. ExamplesAuthenticatefrom pytracker import Tracker
from pytracker import Story
from pytracker import HostedTrackerAuth
def main(argv):
auth = HostedTrackerAuth('username', 'password')
tracker = Tracker(10101, auth)Fetch a storystory = tracker.GetStory(684566) Create a storystory = Story()
story.SetName('wake up')
story.SetEstimate(1)
tracker.AddNewStory(story)Update an existing storystory = tracker.GetStory(684566)
story.SetCurrentState('delivered')
tracker.UpdateStory(story)Add a commenttracker.AddComment(story_id, 'The customer is always right.') Add a labelstory = tracker.GetStory(44)
story.AddLabel("api")
tracker.UpdateStory(story)Query with filterstories = tracker.GetStories('type:release')See Tracker Search Help for query language. Apply an update to multiple storiesstories = tracker.GetStories('owner:"party cat"')
changes = Story()
changes.SetOwnedBy('bro')
changes.SetEstimate(8)
for story in stories:
tracker.UpdateStoryById(story.GetStoryId(), changes)Delete a storytracker.DeleteStory(44) |