[英]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.