Skip to content

Instantly share code, notes, and snippets.

@chrismetcalf
Created September 30, 2009 18:20
Show Gist options
  • Save chrismetcalf/198315 to your computer and use it in GitHub Desktop.
Save chrismetcalf/198315 to your computer and use it in GitHub Desktop.
# One-liner to bulk-reassign Pivotal Tracker stories
curl -H "X-TrackerToken: $PIVOTAL_TOKEN" -X GET "http://www.pivotaltracker.com/services/v2/projects/$PROJECT_ID/stories?filter=owner:$OLD_OWNER" | \
egrep '^ <id type' | perl -ne 'm/>(\d+)</; print "$1\n";' | \
while read id; do curl -H "X-TrackerToken: $PIVOTAL_TOKEN" -H "Content-type: application/xml" \
-d "<story><owned_by>$NEW_OWNER</owned_by></story>" -X PUT \
"http://www.pivotaltracker.com/services/v2/projects/$PROJECT_ID/stories/$id"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment