当前位置: 首页>>代码示例>>Python>>正文


Python JIRA.create_issue_link方法代码示例

本文整理汇总了Python中jira.JIRA.create_issue_link方法的典型用法代码示例。如果您正苦于以下问题:Python JIRA.create_issue_link方法的具体用法?Python JIRA.create_issue_link怎么用?Python JIRA.create_issue_link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jira.JIRA的用法示例。


在下文中一共展示了JIRA.create_issue_link方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: jira_client

# 需要导入模块: from jira import JIRA [as 别名]
# 或者: from jira.JIRA import create_issue_link [as 别名]

#.........这里部分代码省略.........
            if "bot-analyzed" not in jira_issue.fields.labels:
                print("Updating issue description: \n" + "\n".join(new_lines))
                jira_issue.update(
                    description=jira_issue.fields.description + "\n".join(new_lines))
            else:
                print("Skipping issue update, since issue is already tagged with 'bot-analyzed'")
        except JIRAError as e:
            print("Error updating JIRA: " + str(e))


# jira.resolutions()
# <JIRA Resolution: name='Fixed', id='1'>
# <JIRA Resolution: name="Won't Fix", id='2'>
# <JIRA Resolution: name='Duplicate', id='3'>
# <JIRA Resolution: name='Incomplete', id='4'>
# <JIRA Resolution: name='Cannot Reproduce', id='5'>
# <JIRA Resolution: name='Works as Designed', id='6'>
# <JIRA Resolution: name='Gone away', id='7'>
# <JIRA Resolution: name='Community Answered', id='8'>
# <JIRA Resolution: name='Done', id='9'>

# Issue link Types
# <JIRA IssueLinkType: name='Backports', id='10420'>
# <JIRA IssueLinkType: name='Depends', id='10011'>
# <JIRA IssueLinkType: name='Documented', id='10320'>
# <JIRA IssueLinkType: name='Duplicate', id='10010'>
# <JIRA IssueLinkType: name='Gantt Dependency', id='10020'>
# <JIRA IssueLinkType: name='Gantt End to End', id='10423'>
# <JIRA IssueLinkType: name='Gantt End to Start', id='10421'>
# <JIRA IssueLinkType: name='Gantt Start to End', id='10424'>
# <JIRA IssueLinkType: name='Gantt Start to Start', id='10422'>
# <JIRA IssueLinkType: name='Related', id='10012'>
# <JIRA IssueLinkType: name='Tested', id='10220'>

    def close_as_duplicate(self, issue, duplicate_issue):

        with self._lock:
            src_issue = self.jira.issue(issue)
            dest_issue = self.jira.issue(duplicate_issue)

            # Add duplicate link
            self.jira.create_issue_link(
                type='Duplicate', inwardIssue=issue, outwardIssue=duplicate_issue)

            # Update affectsVersions, Buildvariants, etc.
            title_parsing_regex = re.compile("(Timed Out|Failures?):"
                                             " (?P<suite_name>.*?)"
                                             " on"
                                             " (?P<variant_prefix>[^\(\[]+)"
                                             "(?P<variant_suffix>"
                                             " (?:"
                                             "\(Clang 3\.7/libc\+\+\)|"
                                             "\(No Journal\)|"
                                             "\(inMemory\)|"
                                             "\(ephemeralForTest\)|"
                                             "\(Unoptimized\))(?: DEBUG)?)?"
                                             " (?:\("
                                             "(?P<test_names>(.*?(\.js|CheckReplDBHash)(, )?)*)"
                                             "\))? ?\[MongoDB \("
                                             "(?P<version>.*?)"
                                             "\) @ [0-9A-Za-z]+\]")

            parsed_title = title_parsing_regex.match(src_issue.fields.summary)
            if parsed_title is not None:
                # Update the failing variants.
                variant = parsed_title.group("variant_prefix").rstrip()
                if parsed_title.group("variant_suffix") is not None:
                    variant += parsed_title.group("variant_suffix").rstrip()

                self.add_affected_variant(dest_issue, variant)

                # Update the failing tasks.
                self.add_failing_task(dest_issue, parsed_title.group("suite_name"))

                # Update the affected versions.
                self.add_affected_version(dest_issue, parsed_title.group("version"))

            # Close - id 2
            # Duplicate issue is 3
            self.jira.transition_issue(src_issue, '2', resolution={'id': '3'})

            mongo_client.remove_issue(issue)

    def close_as_goneaway(self, issue):
        with self._lock:
            src_issue = self.jira.issue(issue)

            # Close - id 2
            # Gone away is 7
            self.jira.transition_issue(
                src_issue, '2', comment="Transient machine issue.", resolution={'id': '7'})

            mongo_client.remove_issue(issue)

    def get_bfg_issue(self, issue_number):
        if not issue_number.startswith("BFG-") and not issue_number.startswith("BF-"):
            issue_number = "BFG-" + issue_number
        with self._lock:
            src_issue = self.jira.issue(issue_number)
        return src_issue
开发者ID:markbenvenuto,项目名称:buildbaron,代码行数:104,代码来源:jira_client.py


注:本文中的jira.JIRA.create_issue_link方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。