Skip to content

Comments

fix: handle empty comment body in Jira webhooks#1269

Open
nevyangelova wants to merge 3 commits intomasterfrom
MM-67203
Open

fix: handle empty comment body in Jira webhooks#1269
nevyangelova wants to merge 3 commits intomasterfrom
MM-67203

Conversation

@nevyangelova
Copy link
Contributor

@nevyangelova nevyangelova commented Feb 6, 2026

Summary

When Jira sends a webhook with an empty or whitespace only comment body he plugin was still generating a quote prefix resulting in posts that appeared to have content but displayed nothing. sometimes the comment body is posted and sometimes it's not. This modifies quoteIssueComment() to return an empty string when the comment is empty or contains only whitespace instead of returning just the quote.

Ticket Link

https://mattermost.atlassian.net/browse/MM-67203

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed handling of empty or whitespace-only input to prevent unnecessary formatting processing.
  • Tests

    • Added comprehensive test coverage for comment processing edge cases, including single-line, multi-line, empty, and whitespace-only inputs.

@nevyangelova nevyangelova requested a review from a team as a code owner February 6, 2026 10:37
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch MM-67203

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nevyangelova nevyangelova added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Feb 6, 2026
Copy link
Contributor

@avasconcelos114 avasconcelos114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nevyangelova nevyangelova requested review from devinbinnie and marianunez and removed request for harshilsharma63 February 10, 2026 15:21
@nevyangelova nevyangelova removed the request for review from devinbinnie February 18, 2026 05:49
Copy link

@ogi-m ogi-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Jira Server. I don't see a way to add a whitespace-only comment on Jira Cloud. the Save button is disabled.

This fixed it for the subscription notifications:
image

But, the DM notifications from the Jira bot are still showing the spaces:

image

@nevyangelova
Copy link
Contributor Author

@ogi-m fixed

@nevyangelova nevyangelova requested a review from ogi-m February 19, 2026 05:51
@nevyangelova nevyangelova removed the 2: Dev Review Requires review by a core committer label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3: QA Review Requires review by a QA tester

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants