0

I'm trying to add watchers after creating the issue using python but while adding into after creating issue getting below error, Can anyone help?

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

Code:

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')
DKM
  • 1,761
  • 2
  • 19
  • 34

1 Answers1

0

In your code, the instance of JIRA class is: "self.client"

For add_watcher, you need to use it as: self.client.add_watcher(self.create_aus.id, watcher='UserName')

Gorav Singal
  • 508
  • 3
  • 11