-
-
Notifications
You must be signed in to change notification settings - Fork 299
Feature/ worklog added crud commands: LIST - EDIT - DELETE #908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/ worklog added crud commands: LIST - EDIT - DELETE #908
Conversation
- Add 'jira issue worklog list' command to list worklogs for an issue - Implement GetIssueWorklogs() method in jira client - Add Worklog and WorklogResponse types - Create worklog view with plain and table display modes - Add comprehensive unit tests for worklog functionality - Support both ADF and plain text comment formats - Include documentation for the new feature - Add analysis document for Jira API requests
…-command * feature/worklog-list-command: feat: add worklog list command
- Add 'jira issue worklog edit' command to edit existing worklogs - Implement UpdateIssueWorklog() method in jira client - Support interactive worklog selection from list - Add flags for comment, started date, and timezone - Include comprehensive documentation - Update analysis document with new endpoint
- Add documentation for 'worklog list' command - Add documentation for 'worklog edit' command - Include usage examples and aliases for both commands
- Add 'jira issue worklog delete' command to remove worklogs - Implement DeleteIssueWorklog() method in jira client - Support interactive worklog selection from list - Add confirmation prompt with --force flag to skip - Include aliases: remove, rm - Update README with delete command documentation
- Add error checks for fmt.Fprintf and fmt.Fprintln calls - Pre-allocate slice capacity in worklog data() method - Fix formatting issues (gofmt) - Remove extra whitespace - Align struct field tabs properly
- Add error checks for fmt.Fprintf and fmt.Fprintln calls - Pre-allocate slice capacity in worklog data() method - Fix formatting issues (gofmt) - Remove extra whitespace - Align struct field tabs properly
- Rename delete() to deleteWorklog() to avoid shadowing builtin - Resolves RVV-B0009: Redefinition of builtin - No functional changes, just naming improvement
- Add error check for fmt.Sscanf in delete and edit commands - Fix line continuation formatting in delete confirmation message - Replace magic number 60 with maxCommentLength constant - All golangci-lint issues resolved
- Modify AddIssueWorklog to return *Worklog instead of error only - Display worklog ID in success message after creation - Update README.md with example showing returned ID - Update tests to handle new return signature - Mock response now includes worklog JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive CRUD operations for worklog management by implementing three new commands: list, edit, and delete. These commands complement the existing add command and provide complete worklog lifecycle management through both interactive and non-interactive modes.
Key Changes:
- Added
GetIssueWorklogs,UpdateIssueWorklog, andDeleteIssueWorklogAPI methods - Implemented three new commands with interactive worklog selection
- Modified
AddIssueWorklogto return the created worklog object - Added worklog view layer with table and plain text formatting
- Added comprehensive test coverage for worklog view functions
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/jira/issue.go | Added three new API methods for worklog CRUD operations and modified AddIssueWorklog to return worklog object |
| pkg/jira/issue_test.go | Updated test to verify AddIssueWorklog returns worklog object |
| internal/cmd/issue/worklog/worklog.go | Registered new list, edit, and delete commands |
| internal/cmd/issue/worklog/list/list.go | Implemented worklog list command with table/plain output formats |
| internal/cmd/issue/worklog/edit/edit.go | Implemented worklog edit command with interactive selection |
| internal/cmd/issue/worklog/delete/delete.go | Implemented worklog delete command with confirmation prompt |
| internal/cmd/issue/worklog/add/add.go | Updated to display returned worklog ID in success message |
| internal/view/worklog.go | Added worklog view layer with rendering logic |
| internal/view/worklog_test.go | Added comprehensive unit tests for worklog view functions |
| README.md | Updated documentation with usage examples for new commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Cherry-picked from upstream PR ankitpokhrel#908 by isaacpalomero. Adds full CRUD support for worklogs: - jira issue worklog list ISSUE-KEY - jira issue worklog edit ISSUE-KEY WORKLOG-ID TIME - jira issue worklog delete ISSUE-KEY WORKLOG-ID
Add Worklog Management Commands (list, edit, delete)
Overview
This PR adds comprehensive worklog management capabilities to jira-cli by implementing three new commands:
list,edit, anddelete. These commands complete the CRUD operations for worklog management, complementing the existingaddcommand.Summary of Changes
New Commands
1.
jira issue worklog list- List worklogs for an issue--plainand--tableoutput modesls2.
jira issue worklog edit- Edit existing worklogsupdate3.
jira issue worklog delete- Remove worklogs--forceflag to skip confirmation (for scripts)remove,rm🔧 Technical Implementation
API Endpoints Used
/rest/api/2/issue/{key}/worklog/rest/api/2/issue/{key}/worklog/{id}/rest/api/2/issue/{key}/worklog/{id}Files Added
Files Modified
Features
Worklog List
Worklog Edit
Worklog Delete
--forceflag for non-interactive scriptsUsage Examples
List Worklogs
Edit Worklogs
Delete Worklogs
Complete Worklog Workflow
Testing
Security Considerations
Delete Command Safety
Permissions
All commands respect Jira permissions:
Breaking Changes
None. All changes are additive and backward compatible.
Migration Guide
Not applicable. These are new commands with no migration needed.
Screenshots
Worklog List - Table Format
Worklog List - Plain Format
Interactive Worklog Selection
Delete Confirmation
Author: Isaac Palomero
Date: 2024-11-05
Branch:
feature/worklog-list-and-edit-commandsStatus: Ready for Review