library(httptest) library(magrittr) start_vignette("stories")
Pivotal Tracker is a project management software-as-a-service that provides a REST API.
pivotaltrackR provides an R interface to that API, allowing you to query it and work with its responses. This vignette offers a quick-start guide to working with Stories, the issues that Pivotal Tracker helps you track.
You'll need two settings to start working with Pivotal Tracker in R. First, you'll need the project ID, which you can find in the URL you see in the web browser when you're using the Pivotal Tracker web app, such as
Set these options in your current R session like this, or put that in your
.Rprofile for use in every session.
Let's get started. First, load the package.
"Stories" are the primary objects that you work with in Pivotal Tracker. They're the issues---features, bugs, and chores---that you track. They have a life cycle, in which they are created, may linger in the "icebox" waiting to be scheduled to the "backlog", and once started, go through some stages before they are finally "accepted" as done.
The Pivotal API lets you query your project's stories freely. The easiest way is to use the same searching interface you use in the web application. There are lots of different fields to filter on and ways to select certain stories; these are covered at length on the API documentation.
Let's find all of the open bug reports in our project.
bugs <- getStories(story_type="bug") bugs
Hooray, only two bugs! However, note that if you made a search that did have lots of results,
getStories() handles the API's pagination for you. It will return all search matches, even if it needs multiple API requests to do it. You don't need to worry with the details of the API for that.
Let's say that I need to report a bug. Call
createStory() and give it some details.
new_bug <- createStory( name="Flux capacitor hangs at 0.9 gigawatts", description="Everything seems fine up to then but then it gets stuck. Please investigate and fix.", story_type="bug" ) new_bug
Sys.sleep(1) ## So that Pivotal's API can catch up with us!
See the API docs for a list of all valid fields you can provide.
name is the only required field.
Now when we query our bugs again, we see our newly reported one added to the list.
Time to get cracking on this bug. Let's mark it as started:
new_bug <- editStory(new_bug, current_state="started") getStories(story_type="bug")
As we see, the change is reflected in our story search, and in fact our bug has moved up in the order. Started issues always are listed above unstarted ones, which themselves are ahead of unscheduled ones.
Oops! Turns out that this new bug report is a duplicate of one of the stories we already had. Let's delete it.
Now our bug is no longer in the list.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.