Skip to content

[Bug]: Jira Server/DC [~username] mentions are destroyed on the comment/description write path #1616

Description

@anhdt19942020

Describe the bug

On Jira Server / Data Center (is_cloud=False), user mentions written into a comment or description body are not preserved. Passing a Server-style mention [~username] (or the email form [~huy.vu@example.com]) through add_comment / edit_comment strips the brackets, so Jira never recognizes it as a mention and the user is not notified.

Root cause (from source)

The write path _markdown_to_jira()JiraPreprocessor.markdown_to_jira() (preprocessing/jira.py) has no mention handling at all. The only mention logic, _process_mentions() (preprocessing/jira.py:153), (a) runs only on the read path via clean_jira_text(), and (b) matches only the Cloud pattern \[~accountid:(.*?)\] (jira.py:137) — never the Server/DC [~username] syntax.

On the write path the [~username] token instead collides with the generic link/format regexes (e.g. jira.py:619) and loses its brackets.

Confirmed on main (newer than v0.23.1): the pattern is still accountid-only and still read-path-only.

To Reproduce

Against a Jira Server/DC instance, call jira_add_comment with a body containing [~someuser]. Observed: bracket stripped, no notification. Expected: mention preserved as valid Server wiki markup and the user notified.

Expected behavior

On Server/DC, preserve [~username] verbatim on the write path (Jira Server wiki markup already uses [~username] natively), so mentions survive and notify.

Environment

  • mcp-atlassian: 0.23.0 (also verified against main)
  • Deployment: Jira Server/DC (not Cloud)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions