本文整理汇总了Python中jira.JIRA.issue_link方法的典型用法代码示例。如果您正苦于以下问题:Python JIRA.issue_link方法的具体用法?Python JIRA.issue_link怎么用?Python JIRA.issue_link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jira.JIRA
的用法示例。
在下文中一共展示了JIRA.issue_link方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: JIRA
# 需要导入模块: from jira import JIRA [as 别名]
# 或者: from jira.JIRA import issue_link [as 别名]
jira = JIRA(jira_url, basic_auth=(username, password))
query = 'project = CL AND status != Done and status != Rejected'
num = 0
while True:
query_result = jira.search_issues(query,maxResults=500,startAt=num)
num += 500
if num > query_result.total:
break
for issue in query_result:
issue_timespent = 0
issue_count = 0
for link_id in issue.fields.issuelinks:
inwardIssue = jira.issue_link(link_id).inwardIssue
if inwardIssue.key.startswith('OP-'):
issue_count += 1
time = jira.issue(inwardIssue.key).fields.timespent
if time is not None:
issue_timespent += time
total_time = issue_timespent / 60
# $65 per hour for Ops
total_money = round(total_time / 60 * 65, 2)
if issue_timespent != 0:
print("%s: %s minutes, %s linked tickets, %s dollars, %s" % (
issue.key, total_time, issue_count, total_money, issue.fields.summary))
示例2: timedelta
# 需要导入模块: from jira import JIRA [as 别名]
# 或者: from jira.JIRA import issue_link [as 别名]
query = 'project = Ops and createdDate >=-30d ORDER BY created DESC'
start_date = date.today() - timedelta(days=30)
print("Report for %s to %s" % (start_date, date.today()))
print("Query is", query)
issues = {}
num = 0
while True:
query_result = jira.search_issues(query,maxResults=500,startAt=num)
num += 500
for issue in query_result:
for link_id in issue.fields.issuelinks:
outwardIssue = jira.issue_link(link_id).outwardIssue
if outwardIssue.key.startswith('CL-'):
time = jira.issue(issue.key).fields.timespent
if outwardIssue.key not in issues:
issue2 = jira.issue(outwardIssue)
summary = issue2.fields.summary
priority = issue2.fields.priority
issuetype = issue2.fields.issuetype
status = issue2.fields.status
issues[outwardIssue.key] = {
'issuecount': 0,
'timespent': 0,
'summary': str(summary),
'issuetype': str(issuetype),
'priority': str(priority),