Skip to content

feat: support internal vs external comments for JSM tickets (#103)#170

Merged
Zious11 merged 9 commits intodevelopfrom
worktree-feat-jsm-internal-comments-103
Apr 6, 2026
Merged

feat: support internal vs external comments for JSM tickets (#103)#170
Zious11 merged 9 commits intodevelopfrom
worktree-feat-jsm-internal-comments-103

Conversation

@Zious11
Copy link
Copy Markdown
Owner

@Zious11 Zious11 commented Apr 6, 2026

Summary

  • Added --internal flag to jr issue comment — sets sd.public.comment entity property to mark comments as agent-only on JSM projects
  • Added conditional "Visibility" column to jr issue comments — shows "Internal"/"External" when sd.public.comment property is present (JSM projects), omits column entirely for non-JSM projects
  • Added EntityProperty type and properties field to Comment struct
  • Added ?expand=properties to comment list API to retrieve visibility data

API approach: Standard Jira REST API v3 only — no JSM-specific API needed. Validated against live Jira Cloud instance. The JSM API was evaluated and rejected (only works for service request types, uses plain text instead of ADF).

Closes #103

Test plan

  • cargo fmt --check — no formatting issues
  • cargo clippy -- -D warnings — zero warnings
  • cargo test — all 20 test suites pass, 0 failures
  • Unit tests: Comment deserialization with/without/empty properties (3 tests)
  • Integration tests: existing list_comments tests updated for expand=properties (4 tests)
  • Handler test: --internal flag adds sd.public.comment property to POST body
  • Handler test: no --internal flag omits properties from POST body
  • Handler test: JSM comments show "Internal"/"External" in Visibility column
  • Handler test: non-JSM comments (empty properties) hide Visibility column
  • Live validation: tested against real Jira Cloud instance with JSM and non-JSM projects

@Zious11 Zious11 requested a review from Copilot April 6, 2026 01:14
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 98.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cli/issue/list.rs 97.36% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Jira Service Management (JSM) “internal vs external” comment support to the jr CLI by allowing comment creation to set the sd.public.comment entity property and by displaying comment visibility when available.

Changes:

  • Added --internal flag to jr issue comment and propagated it through the CLI handler to the Jira API client.
  • Extended Comment to include properties (entity properties) and updated comment listing to request expand=properties.
  • Updated jr issue comments table output to conditionally show a “Visibility” column (“Internal”/“External”) when the JSM property is present.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/comments.rs Updates mocked comment-list requests to expect expand=properties.
tests/cli_handler.rs Adds handler-level tests for --internal POST payload and Visibility column behavior.
src/types/jira/issue.rs Introduces EntityProperty and adds properties to Comment plus deserialization tests.
src/cli/mod.rs Adds --internal flag to the issue comment subcommand.
src/cli/issue/workflow.rs Passes the internal flag through to the API client when creating comments.
src/cli/issue/list.rs Adds visibility extraction and conditional “Visibility” column for comment tables.
src/api/jira/issues.rs Adds internal parameter to add_comment (sets sd.public.comment) and adds expand=properties to list_comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Zious11 Zious11 merged commit 8946e04 into develop Apr 6, 2026
7 checks passed
@Zious11 Zious11 deleted the worktree-feat-jsm-internal-comments-103 branch April 6, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support internal vs external comments for JSM tickets

3 participants