feat: support internal vs external comments for JSM tickets (#103)#170
Merged
feat: support internal vs external comments for JSM tickets (#103)#170
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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
--internalflag tojr issue commentand propagated it through the CLI handler to the Jira API client. - Extended
Commentto includeproperties(entity properties) and updated comment listing to requestexpand=properties. - Updated
jr issue commentstable 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--internalflag tojr issue comment— setssd.public.commententity property to mark comments as agent-only on JSM projectsjr issue comments— shows "Internal"/"External" whensd.public.commentproperty is present (JSM projects), omits column entirely for non-JSM projectsEntityPropertytype andpropertiesfield toCommentstruct?expand=propertiesto comment list API to retrieve visibility dataAPI 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 issuescargo clippy -- -D warnings— zero warningscargo test— all 20 test suites pass, 0 failuresCommentdeserialization with/without/empty properties (3 tests)list_commentstests updated forexpand=properties(4 tests)--internalflag addssd.public.commentproperty to POST body--internalflag omits properties from POST body