'Add the issues in ``issue_keys`` to the ``sprint_id``.
The sprint must be started but not completed.
If a sprint was completed, then have to also edit the history of the
issue so that it was added to the sprint before it was completed,
preferably before it started. A completed sprint\'s issues also all have
a resolution set before the completion date.
If a sprint was not started, then have to edit the marker and copy the
rank of each issue too.
:param sprint_id: the sprint to add issues to
:param issue_keys: the issues to add to the sprint'

def add_issues_to_sprint(self, sprint_id, issue_keys):

    if (self._options[u'agile_rest_path'] == GreenHopperResource.AGILE_BASE_REST_PATH):
        url = self._get_url((u'sprint/%s/issue' % sprint_id), base=self.AGILE_BASE_URL)
        payload = {u'issues': issue_keys}
        try:
            self._session.post(url, data=json.dumps(payload))
        except JIRAError as e:
            if (e.status_code == 404):
                warnings.warn(u'Status    code    404    may    mean,    that    too    old    JIRA    Agile    version    is    installed.    At    least    version    6.7.10    is    required.')
            raise
    elif (self._options[u'agile_rest_path'] == GreenHopperResource.GREENHOPPER_REST_PATH):
        sprint_field_name = u'Sprint'
        sprint_field_id = [f[u'schema'][u'customId'] for f in self.fields() if (f[u'name'] == sprint_field_name)][0]
        data = {u'idOrKeys': issue_keys, u'customFieldId': sprint_field_id, u'sprintId': sprint_id, u'addToBacklog': False}
        url = self._get_url(u'sprint/rank', base=self.AGILE_BASE_URL)
        return self._session.put(url, data=json.dumps(data))
    else:
        raise NotImplementedError((u'No    API    for    adding    issues    to    sprint    for    agile_rest_path="%s"' % self._options[u'agile_rest_path']))
