[英]Getting error while adding watcher to JIRA ticket using JIRA python API
我在尝试使用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')
在您的代码中,JIRA类的实例为:“ self.client”
对于add_watcher,您需要将其用作:self.client.add_watcher(self.create_aus.id,watcher ='UserName')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.