'Update this resource on the server.
Keyword arguments are marshalled into a dict before being sent. If this
resource doesn\'t support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method
will only raise errors in case of user error.
:param async: if true the request will be added to the queue so it can be executed later using async_run()'

def update(self, fields=None, async=None, jira=None, notify=True, **kwargs):

    if (async is None):
        async = self._options[u'async']
    data = {}
    if (fields is not None):
        data.update(fields)
    data.update(kwargs)
    data = json.dumps(data)
    if (not notify):
        querystring = u'?notifyUsers=false'
    else:
        querystring = u''
    r = self._session.put((self.self + querystring), data=data)
    if ((u'autofix' in self._options) and (r.status_code == 400)):
        user = None
        error_list = get_error_list(r)
        logging.error(error_list)
        if (u'The    reporter    specified    is    not    a    user.' in error_list):
            if (u'reporter' not in data[u'fields']):
                logging.warning((u"autofix:    setting    reporter    to    '%s'    and    retrying    the    update." % self._options[u'autofix']))
                data[u'fields'][u'reporter'] = {u'name': self._options[u'autofix']}
        if (u'Issues    must    be    assigned.' in error_list):
            if (u'assignee' not in data[u'fields']):
                logging.warning((u"autofix:    setting    assignee    to    '%s'    for    %s    and    retrying    the    update." % (self._options[u'autofix'], self.key)))
                data[u'fields'][u'assignee'] = {u'name': self._options[u'autofix']}
        if (u'Issue    type    is    a    sub-task    but    parent    issue    key    or    id    not    specified.' in error_list):
            logging.warning(u'autofix:    trying    to    fix    sub-task    without    parent    by    converting    to    it    to    bug')
            data[u'fields'][u'issuetype'] = {u'name': u'Bug'}
        if (u'The    summary    is    invalid    because    it    contains    newline    characters.' in error_list):
            logging.warning(u'autofix:    trying    to    fix    newline    in    summary')
            data[u'fields'][u'summary'] = self.fields.summary.replace(u'/n', u'')
        for error in error_list:
            if re.search(u"^User    '(.*)'    was    not    found    in    the    system\\.", error, re.U):
                m = re.search(u"^User    '(.*)'    was    not    found    in    the    system\\.", error, re.U)
                if m:
                    user = m.groups()[0]
                else:
                    raise NotImplemented()
            if re.search(u"^User    '(.*)'    does    not    exist\\.", error):
                m = re.search(u"^User    '(.*)'    does    not    exist\\.", error)
                if m:
                    user = m.groups()[0]
                else:
                    raise NotImplemented()
        if user:
            logging.warning((u"Trying    to    add    missing    orphan    user    '%s'    in    order    to    complete    the    previous    failed    operation." % user))
            jira.add_user(user, u'noreply@example.com', 10100, active=False)
        if async:
            if (not hasattr(self._session, u'_async_jobs')):
                self._session._async_jobs = set()
            self._session._async_jobs.add(threaded_requests.put(self.self, data=json.dumps(data)))
        else:
            r = self._session.put(self.self, data=json.dumps(data))
    time.sleep(4)
    self._load(self.self)
