def warn_regression(jira_plugin, jira_issue, test, message, *, message_format):
    """
    Send a message to mark a regression. And add it to the ``jira_plugin.regressions`` list.

    .. note::

        We call a regression a bug that was once known, then fixed and appeared once again as test run fails.

    :param jira_issue: the jira issue object
    :param test: test case
    :type test: unittest.TestCase
    :param message: the message to send
    :param message_format: the message format. As of 1.0 we use ``str.format`` syntax and accepted keys are ``test``
    and ``message``
    """
    from nose2_contrib.jira.jira_plugin import JiraRegression
    if not jira_plugin.connected:
        return
    jira_plugin.jira_client.add_comment(jira_issue, message_format.format(
        test=test, message=message))
    jira_plugin.regressions.append(JiraRegression(jira_issue.id, test, message)
        )
