Eu uso este script para ser o rastreador central da consulta na linha de comando
import requests
import sys
from lxml import etree
TOKEN='YOUR TOKEN GOES HERE'
PROJECT_URL = 'YOUR PROJECT URL GOES HERE'
def main(args):
query = ' '.join(args)
xml = get_stories(query)
parse(xml)
def parse(xml):
root = etree.fromstring(xml)
for story in root.getchildren():
id = story.find('id').text
name = story.find('name').text
print "%s %s" % (id, name)
def get_stories(query, token=TOKEN, url=PROJECT_URL):
payload = {'filter': query}
headers = {'X-TrackerToken': token}
response = requests.get(url, params=payload, headers=headers)
return response.content
if __name__ == '__main__':
main(sys.argv[1:])
O uso é assim:
$ pivotal state:unscheduled,unstarted,started label:myproject