def make_jira_message(changeinfo, goal_state):
    """
  Create a string to post as a message when transitioning a jira issue
  due to a commit moving through gerrit.
  """
    fmtargs = dict(goal_state=goal_state, owner='{name} <{email}>'.format(
        **changeinfo['owner']), branch=changeinfo.get('branch', '?'),
        current_revision=changeinfo['current_revision'], change_id=
        changeinfo['change_id'])
    return (
        """
Automatically generated message:

This issue was advanced to {goal_state} due to a gerrit change
by {owner} on branch {branch} currently at commit
{current_revision}.
See: https://gerrit.skyd.io/#/q/{change_id}
"""
        .format(**fmtargs))
