def __add_comment()

in migration/src/add_comments_jira_issues.py [0:0]


def __add_comment(token: str, issue_id: str, comment: str, logger: Logger) -> bool:
    url = JIRA_API_BASE + f"/issue/{issue_id}/comment"
    headers = {"Authorization": f"Bearer {token}"}
    data = {"body": comment}
    res = requests.post(url, headers=headers, json=data)
    time.sleep(INTERVAL_IN_SECONDS)
    if res.status_code != 201:
        logger.error(f"Failed to add a comment to {issue_id}; status_code={res.status_code}, message={res.text}")
        return False
    return True