blob: beec6c23868edf226d671620ac87ce01e5cd30f6 [file] [log] [blame]
# This example uses Google APIs Client for Python, you can download it here:
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import apiclient
import httplib2
from oauth2client.file import Storage
# Get credentials to authorize http object
storage = Storage('Your-local-credential-file')
credentials = storage.get()
http = credentials.authorize(httplib2.Http())
# Create monorail client using Google APIs Client for Python
monorail =
'monorail', 'v1',
# Create a chromium project issue
insert_response = monorail.issues().insert(projectId='chromium', body={
'summary': 'Strange grinding sound',
'status': 'Untriaged',
'cc': [{'name':''}, {'name':''}]
new_issue_id = insert_response['id']
# Get all issues of chromium
list_response = monorail.issues().list(projectId='chromium').execute()
issues = list_response['items']
total_issues = list_response['totalResults']