使用JIRA python API向JIRA票证添加观察程序时出错

2024-04-25 03:49:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试在使用python创建问题之后添加观察者,但是在创建问题之后添加到getting below error时,有人能帮忙吗?你知道吗

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')

Tags: instancenameselfaddvaluecreatejiraissue
1条回答
网友
1楼 · 发布于 2024-04-25 03:49:54

在您的代码中,JIRA类的实例是:“自助客户端““

对于add\u watcher,您需要将其用作: self.client.add\u观察程序(自创.id,watcher='UserName')

相关问题 更多 >