本文整理汇总了Python中jira.JIRA.add_issues_to_sprint方法的典型用法代码示例。如果您正苦于以下问题:Python JIRA.add_issues_to_sprint方法的具体用法?Python JIRA.add_issues_to_sprint怎么用?Python JIRA.add_issues_to_sprint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jira.JIRA
的用法示例。
在下文中一共展示了JIRA.add_issues_to_sprint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateIssues
# 需要导入模块: from jira import JIRA [as 别名]
# 或者: from jira.JIRA import add_issues_to_sprint [as 别名]
def updateIssues(issuelist, NEXTorDOTX, description):
numExistingIssues = len(issuelist) if not issuelist == None else 0
if numExistingIssues > 0 :
if debug: print "[DEBUG] Move " + str(numExistingIssues) + " " + description
jira = JIRA(options={'server':jiraserver}, basic_auth=(jirauser, jirapwd))
cnt = 0
for s in issuelist :
key = components.getText(components.findChildNodeByName(s, 'key').childNodes)
issue = jira.issue(key)
cnt += 1
doThisJIRA = True
whichLabelSkipped = ""
for label in issue.fields.labels:
for skipLabel in skipLabels:
if label == skipLabel.strip():
whichLabelSkipped = label
doThisJIRA = False
linkURL = components.getText(components.findChildNodeByName(s, 'link').childNodes)
summary = components.getText(components.findChildNodeByName(s, 'summary').childNodes).strip()
operation = " + [" + str(cnt) + "/" + str(len(issuelist)) + "] Update " + linkURL + " : " + summary
if debug: operation = operation + " :: " + str(issue.fields.labels)
if doThisJIRA == False:
operation = " - [" + str(cnt) + "/" + str(len(issuelist)) + "] -Skip- " + linkURL + " (" + whichLabelSkipped + ") : " + summary
print operation
else:
if options.autoApplyChanges or options.dryrun:
print operation
yesno = ""
else:
yesno = raw_input(operation + " ? [y/N] ")
if options.autoApplyChanges or yesno.capitalize() in ["Y"]:
# move issue to next fixversion
if components.findChildNodeByName(s, 'project').attributes["key"].value == "JBIDE": # JBIDE or JBDS
fixversion = version_jbt
fixversion_NEXT = version_jbt_NEXT if NEXTorDOTX else version_jbt_DOTX
else:
fixversion = version_ds
fixversion_NEXT = version_ds_NEXT if NEXTorDOTX else version_ds_DOTX
fixVersions = []
# NOTE: if there is more than one fixversion, the others will not be changed
for version in issue.fields.fixVersions:
if version.name != fixversion:
fixVersions.append({'name': version.name})
fixVersions.append({'name': fixversion_NEXT})
issue.update(fields={'fixVersions': fixVersions})
# only for NEXT, not for .x
if NEXTorDOTX:
# move issue to new sprint
jira.add_issues_to_sprint(sprintId_NEXT, [key])
jira.add_comment(key, "[checkUnresolvedIssues.py] Slip to fixversion = *" + fixversion_NEXT + "* and sprint = *" + sprint_NEXT + "*")
else:
jira.add_comment(key, "[checkUnresolvedIssues.py] Slip to fixversion = *" + fixversion_NEXT + "*")