def jira_role(name, rawtext, text, lineno, inliner,
              options=None, content=None, oxford_comma=True):
    """Sphinx role for referencing a JIRA ticket.

    Examples::

        :jira:`DM-6181` -> DM-6181
        :jira:`DM-6181,DM-6181` -> DM-6180 and DM-6181
        :jira:`DM-6181,DM-6181,DM-6182` -> DM-6180, DM-6181, and DM-6182
    """
    options = options or {}
    content = content or []
    config = inliner.document.settings.env.app.config

    ticket_ids = [each.strip() for each in utils.unescape(text).split(',')]
    n_tickets = len(ticket_ids)

    if oxford_comma:
        sep_factory = _oxford_comma_separator
    else:
        sep_factory = _comma_separator

    node_list = []
    for i, ticket_id in enumerate(ticket_ids):
        node = _make_ticket_node(ticket_id, config, options=options)
        node_list.append(node)
        sep_text = sep_factory(i, n_tickets)
        if sep_text is not None:
            sep = nodes.raw(text=sep_text, format='html')
            node_list.append(sep)
    return node_list, []