#coding=utf8
#https://jira.readthedocs.io/en/latest/jirashell.html
from
jira
import
JIRA
jira
=
JIRA(
'http://jira.uyunsoft.cn'
,basic_auth
=
(
'qiuting'
,
'qiuting160328'
))
projects
=
jira.projects()
# print (projects)
project_names
=
[]
for
i
in
projects:
project_names.append(i.key)
# print (jira.fields())
#
# print (','.join(project_names))
# props = jira.application_properties()
# print props
issue
=
jira.issue(
'DOG-2134'
)
tasks
=
issue.fields.subtasks
print
(issue.key, issue.fields.created, issue.fields.status.name, issue.fields.status.
id
,
issue.fields.reporter.displayName,
issue.fields.assignee.displayName, issue.fields.fixVersions[
0
].name)
for
task_item
in
tasks:
task
=
jira.issue(task_item.key)
print
(task.key, task.fields.created, task.fields.status.name, task.fields.status.
id
,
task.fields.reporter.displayName,
task.fields.assignee.displayName, task.fields.fixVersions[
0
].name)
# break
# issue = jira.issue('APM-1226', fields='summary,description,comment')
# print issue.fields.__module__
# summary = issue.fields.summary
# # description = issue.fields.description
# print issue,summary