-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
93 lines (67 loc) · 1.87 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
########
import sys
sys.path.append('src')
import api
########
result = api.get_projects()
print
for key, val in result.iteritems():
print key, val
items = result['items']
print
print 'Items:'
for item in items: #Note: This is actually a list of the projects.
print item
# Look at project 0.
item = items[0]
print
print 'Items[0]:'
for key, val in item.iteritems():
print key, val
# Lookup a non-archived project (case sensitive)
project_id = api.lookup_project_id('Test Project')
print
print 'Project:', project_id
# Get the stories for project.
print
print 'Stories:'
stories = api.list_stories(project_id)
storiesDict=dict()
for item in stories['items']:
print 'raw:', item
print 'id: ', item['id']
print ' color:', item['color']
print ' priority:', item['priority']
print ' item:', item['text']
print ' details:', item['details']
print ' comments:', item['comments']
print ' tasks:', item['tasks']
print ' milestones:', item['milestones']
storiesDict[item['id']]=item
print 'storiesDict:'
print storiesDict
story=4
print "Here's story " + str(story)
print storiesDict[story]
print "Here's story " + str(story) + "'s comments"
comments=storiesDict[story]['comments']
print comments
for item in comments:
print item['text']
print item['createTime']
print item['author']['userName']
zzz=raw_input('Waiting...')
print 'Milestones for item ' + str(story)
milestones= storiesDict[story]['milestones']
for item in milestones:
print item
print 'Test Pull stories by username'
stories=api.list_stories_filter_by_user_and_tag(project_id,user='smroszczak')
for item in stories:
print item
print 'Test Pull stories by tag'
stories=api.list_stories_filter_by_user_and_tag(project_id,tag='government_renewal')
print stories
for item in stories:
print item
#print 'Test Pull stories by tag and username'