'Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished.'

def backup(self, filename=u'backup.zip', attachments=False):

    if (self.deploymentType == u'Cloud'):
        url = (self._options[u'server'] + u'/rest/obm/1.0/runbackup')
        payload = json.dumps({u'cbAttachments': attachments})
        self._options[u'headers'][u'X-Requested-With'] = u'XMLHttpRequest'
    else:
        url = (self._options[u'server'] + u'/secure/admin/XmlBackup.jspa')
        payload = {u'filename': filename}
    try:
        r = self._session.post(url, headers=self._options[u'headers'], data=payload)
        if (r.status_code == 200):
            return True
        else:
            logging.warning((u'Got    %s    response    from    calling    backup.' % r.status_code))
            return r.status_code
    except Exception as e:
        logging.error(u'I    see    %s', e)
