'Perform a transition on an issue.
Each keyword argument (other than the predefined ones) is treated as a field name and the argument\'s value
is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments
will be ignored. Field values will be set on the issue as part of the transition process.
:param issue: ID or key of the issue to perform the transition on
:param transition: ID or name of the transition to perform
:param comment: *Optional* String to add as comment to the issue when
performing the transition.
:param fields: a dict containing field names and the values to use.
If present, all other keyword arguments will be ignored'

@translate_resource_args
def transition_issue(self, issue, transition, fields=None, comment=None, **fieldargs):

    transitionId = None
    try:
        transitionId = int(transition)
    except Exception:
        transitionId = self.find_transitionid_by_name(issue, transition)
        if (transitionId is None):
            raise JIRAError((u'Invalid    transition    name.    %s' % transition))
    data = {u'transition': {u'id': transitionId}}
    if comment:
        data[u'update'] = {u'comment': [{u'add': {u'body': comment}}]}
    if (fields is not None):
        data[u'fields'] = fields
    else:
        fields_dict = {}
        for field in fieldargs:
            fields_dict[field] = fieldargs[field]
        data[u'fields'] = fields_dict
    url = self._get_url(((u'issue/' + str(issue)) + u'/transitions'))
    r = self._session.post(url, data=json.dumps(data))
    try:
        r_json = json_loads(r)
    except ValueError as e:
        logging.error((u'%s\n%s' % (e, r.text)))
        raise e
    return r_json
