def add_comment(jira_plugin, jira_issue, test, message, *, message_format):
    """
    Write comment to notify test success.

    :param jira_issue: the jira issue object
    :param test: the test case
    :param message: the success message
    :param message_format: the message format. As of 1.0 we use ``str.format`` syntax and accepted keys are ``test``
    and ``message``
    """
    if not jira_plugin.connected:
        return
    jira_plugin.jira_client.add_comment(jira_issue, message_format.format(
        test=test, message=message))
    jira_plugin.logger.info('Comment sent to %(jira_issue_id)s for %(test)s',
        extra=dict(jira_issue_id=jira_issue.id, test=test))
