【问题标题】:Getting error while adding watcher to JIRA ticket using JIRA python API使用 JIRA python API 将观察者添加到 JIRA 票证时出错
【发布时间】:2018-11-01 06:06:10
【问题描述】:

我正在尝试在使用 python 创建问题后添加观察者,但在创建问题后添加到错误以下,有人可以帮忙吗?

TypeError: unbound method add_watcher() must be called with JIRA instance as first argument (got unicode instance instead)

代码:

def aus_issue(self):
    self.issue_aus = {
        'project': {'key': 'MOS'},
        'issuetype': {'name': 'Reporting'},
        'summary': 'Test NDP Data Audit {} AUS'.format(Jira.date_create().strftime('%B')),
        'description': self.description,
        'customfield_10038': {'value': 'AUS'},
        'customfield_10052': {'value': 'Ad hoc'},
        'customfield_10053': {'value': 'Monthly'},
        "assignee": {
            "name": ""
        }, 'duedate': str(Jira.sixth_day())}

    self.create_aus = self.client.create_issue(fields=self.issue_aus, prefetch=True)
    JIRA.add_watcher(self.create_aus.id, watcher='UserName')

【问题讨论】:

    标签: python python-2.7 jira jira-rest-api python-jira


    【解决方案1】:

    在您的代码中,JIRA 类的实例是:“self.client”

    对于 add_watcher,您需要将其用作: self.client.add_watcher(self.create_aus.id, watcher='UserName')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-27
      • 2015-03-17
      • 2015-03-24
      • 1970-01-01
      • 2016-07-12
      • 2015-08-28
      相关资源
      最近更新 更多