Last active
December 14, 2015 14:49
-
-
Save ejhayes/5103674 to your computer and use it in GitHub Desktop.
Basic trac api usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Login and authenticate | |
from xmlrpclib import ServerProxy | |
p = ServerProxy('http://USERNAME:PASSWORD@trac/storm/login/rpc') | |
# Query tickets and print out the results | |
for i in p.ticket.query('owner=eric&status!=closed'): | |
p.ticket.get(i) | |
# What ticket attributes are available to pass to the attributes struct? | |
p.ticket.getTicketFields() | |
# Get basic ticket info | |
p.ticket.get(24525) | |
# Get ticket changelog info | |
p.ticket.changeLog(24525) | |
# Multicall with only 1 call | |
p.system.multicall([{'methodName': 'ticket.get', 'params': [24525]}]) | |
# Get a ticket and hte changelog in 1 call | |
p.system.multicall([{'methodName': 'ticket.get', 'params': [24525]},{'methodName': 'ticket.changeLog', 'params': [24525]}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment