Skip to content

feat: Support CSV when listing issues#854

Merged
ankitpokhrel merged 4 commits intomainfrom
feat-csv-out
May 25, 2025
Merged

feat: Support CSV when listing issues#854
ankitpokhrel merged 4 commits intomainfrom
feat-csv-out

Conversation

@ankitpokhrel
Copy link
Owner

@ankitpokhrel ankitpokhrel commented May 24, 2025

Relates to #820

$ jira issue list --csv

TYPE,KEY,SUMMARY,STATUS,ASSIGNEE,REPORTER,PRIORITY,RESOLUTION,CREATED,UPDATED,LABELS
Task,ANK-612,deps update test,To Do,,Ankit,Medium,,2025-03-24 13:50:58,2025-03-24 13:50:58,
Task,ANK-611,Test pr 801,To Do,,Ankit,Medium,,2025-03-24 13:00:04,2025-03-24 13:00:38,
Task,ANK-610,"Lorem checksum pound sit amet, consectetur adipiscing elit. Sed lacinia rhoncus turpis sed fermentum.",To Do,,Ankit,High,,2025-03-23 14:55:42,2025-03-23 14:55:43,"p2,q3"
Task,ANK-609,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lacinia rhoncus turpis sed fermentum.",To Do,,Ankit,High,,2025-03-23 14:53:31,2025-03-23 14:53:32,"p2,q3"
Task,ANK-608,Another pr 775 test,To Do,,Ankit,Medium,,2025-03-15 17:06:23,2025-03-15 17:06:23,
Task,ANK-607,Testing pr 775,To Do,,Ankit,Medium,,2025-03-15 17:05:59,2025-03-15 17:06:00,
Story,ANK-606,[Test[] Something,To Do,,Ankit,Medium,,2025-01-16 23:16:04,2025-03-15 16:58:50,
Story,ANK-605,something,To Do,,Ankit,Medium,,2025-01-16 23:14:46,2025-01-16 23:14:46,
Task,ANK-604,Another task with child,To Do,,Ankit,Medium,,2024-08-24 14:35:21,2024-08-24 14:35:21,
Sub-task,ANK-603,Subtask with parent 602,To Do,,Ankit,Medium,,2024-08-24 14:34:31,2024-08-24 14:40:50,

@ankitpokhrel ankitpokhrel requested a review from Copilot May 24, 2025 18:14
Copy link

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

This PR adds support for CSV output when listing issues across various commands.

  • Introduce a CSV flag in DisplayFormat and wire it through issue, sprint, and epic list commands
  • Implement renderCSV to output table data in CSV format
  • Update README to document the new --csv flag

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/view/issues.go Add CSV branch in renderer and header logic
internal/view/helper.go Import encoding/csv and add renderCSV
internal/cmd/sprint/list/list.go Add --csv flag handling in sprint list
internal/cmd/issue/list/list.go Add --csv flag handling in issue list
internal/cmd/epic/list/list.go Add --csv flag handling in epic list
README.md Document --csv usage for issue list
Comments suppressed due to low confidence (2)

internal/view/helper.go:173

  • Consider adding unit tests for renderCSV to verify CSV formatting, header inclusion/exclusion, and error handling.
func renderCSV(w io.Writer, data tui.TableData) error {

internal/cmd/sprint/list/list.go:124

  • [nitpick] The local variable name csv can be confused with the encoding/csv package; consider renaming it to csvFlag for clarity.
csv, err := flags.GetBool("csv")

@@ -169,6 +170,22 @@ func renderPlain(w io.Writer, data tui.TableData) error {
return nil
}

Copy link

Copilot AI May 24, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment for renderCSV should follow Go doc conventions and start with the function name and proper capitalization: "// renderCSV renders issues in CSV format."

Suggested change
// renderCSV renders the provided table data in CSV format and writes it to the given writer.

Copilot uses AI. Check for mistakes.
ankitpokhrel and others added 3 commits May 24, 2025 20:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ankitpokhrel ankitpokhrel marked this pull request as ready for review May 25, 2025 10:00
@ankitpokhrel ankitpokhrel merged commit 8ae1875 into main May 25, 2025
3 of 4 checks passed
@ankitpokhrel ankitpokhrel deleted the feat-csv-out branch May 25, 2025 10:08
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 2, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ankitpokhrel/jira-cli](https://github.com/ankitpokhrel/jira-cli) | minor | `v1.6.0` -> `v1.7.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>ankitpokhrel/jira-cli (ankitpokhrel/jira-cli)</summary>

### [`v1.7.0`](https://github.com/ankitpokhrel/jira-cli/releases/tag/v1.7.0)

[Compare Source](ankitpokhrel/jira-cli@v1.6.0...v1.7.0)

This release adds CSV and JSON output support for issue listings and upgrades deprecated endpoints to ensure compatibility with the latest Jira APIs.

> \[!IMPORTANT]
>
> - The [new API](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-jql-get) does not return the total number of entries anymore, so the total issue count is no longer displayed in the search results.
> - Consequently, the `startAt` parameter in the new API is unsupported. Therefore, the `from` part of the `--paginate=<from>:<limit>` flag is effectively ignored. Users can still paginate using the maxResults parameter (e.g., --paginate=10).

#### 🥷 What's added?

- feat: Add option to list issues in raw JSON by [@&#8203;evg656e](https://github.com/evg656e) in [#&#8203;840](ankitpokhrel/jira-cli#840)
- feat: Add releases Subcommand by [@&#8203;vkhitrin](https://github.com/vkhitrin) in [#&#8203;851](ankitpokhrel/jira-cli#851)
- feat: Support num comments in issue list cmd by [@&#8203;ankitpokhrel](https://github.com/ankitpokhrel) in [#&#8203;853](ankitpokhrel/jira-cli#853)
- feat: Support CSV when listing issues by [@&#8203;ankitpokhrel](https://github.com/ankitpokhrel) in [#&#8203;854](ankitpokhrel/jira-cli#854)
- feat: Allow skipping notification on edit by [@&#8203;ankitpokhrel](https://github.com/ankitpokhrel) in [#&#8203;855](ankitpokhrel/jira-cli#855)
- feat: Add command line arg delimiter for custom delimiter instead of tab. by [@&#8203;iksi4prs](https://github.com/iksi4prs) in [#&#8203;662](ankitpokhrel/jira-cli#662)
- feat: Add support for environment variable to specify config file path by [@&#8203;aazon](https://github.com/aazon) in [#&#8203;858](ankitpokhrel/jira-cli#858)

#### 🐞 What's fixed?

- fix: usernames can be 2 chars by [@&#8203;jontyq](https://github.com/jontyq) in [#&#8203;890](ankitpokhrel/jira-cli#890)
- fix: Update deprecated endpoint by [@&#8203;ankitpokhrel](https://github.com/ankitpokhrel) in [#&#8203;892](ankitpokhrel/jira-cli#892)
- fix: csv format priority by [@&#8203;ciricc](https://github.com/ciricc) in [#&#8203;882](ankitpokhrel/jira-cli#882)

#### ☕️ Other changes

- chore(docs): Add packaging stats to Installation section in README.md by [@&#8203;kskarthik](https://github.com/kskarthik) in [#&#8203;857](ankitpokhrel/jira-cli#857)

#### New Contributors

- [@&#8203;evg656e](https://github.com/evg656e) made their first contribution in [#&#8203;840](ankitpokhrel/jira-cli#840)
- [@&#8203;vkhitrin](https://github.com/vkhitrin) made their first contribution in [#&#8203;851](ankitpokhrel/jira-cli#851)
- [@&#8203;iksi4prs](https://github.com/iksi4prs) made their first contribution in [#&#8203;662](ankitpokhrel/jira-cli#662)
- [@&#8203;aazon](https://github.com/aazon) made their first contribution in [#&#8203;858](ankitpokhrel/jira-cli#858)
- [@&#8203;jontyq](https://github.com/jontyq) made their first contribution in [#&#8203;890](ankitpokhrel/jira-cli#890)
- [@&#8203;ciricc](https://github.com/ciricc) made their first contribution in [#&#8203;882](ankitpokhrel/jira-cli#882)
- [@&#8203;kskarthik](https://github.com/kskarthik) made their first contribution in [#&#8203;857](ankitpokhrel/jira-cli#857)

**Full Changelog**: <ankitpokhrel/jira-cli@v1.6.0...v1.7.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45MS4zIiwidXBkYXRlZEluVmVyIjoiNDEuOTEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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.

2 participants