Skip to content
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

Jira table template sometimes gets messed up #176

Closed
vanniktech opened this issue May 7, 2018 · 3 comments
Closed

Jira table template sometimes gets messed up #176

vanniktech opened this issue May 7, 2018 · 3 comments
Labels

Comments

@vanniktech
Copy link
Contributor

I really like the default table template however often times it does not scale well enough and one line is not shown correctly.

Expected:

+----------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue          | Summary                                                                                                                                        | Type         | Priority     | Status       | Age        | Reporter     | Assignee     |
+----------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| foo            |                                                                                                                                                |              |              |              |            |              | 123456789410 |
+----------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+

Actual:

+----------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue          | Summary                                                                                                                                        | Type         | Priority     | Status       | Age        | Reporter     | Assignee     |
+----------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| foo            |                                                                                                                                                |              |              |              |            |              | 12345678941011
|
+----------------+------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+

This happens on both my Linux as well as on my Mac machine. My hint is that the content of one of the column is too long and there's an off by one error.

@coryb
Copy link
Contributor

coryb commented May 18, 2018

Yeah, the table configuration is a bit brittle. It is a bit tricky to wedge it in with the current templating output, but I think we could provide more helper functions template functions to make this better. I will try to come up with something better.

@kbakk
Copy link

kbakk commented Jul 2, 2019

While the template feature is nice, it would also be good with a simpler way to specify columns to include - eg. something like jira list --table=Key,Summary,Type,Status,MyField:.customfield_11050

@dobbymoodge
Copy link

I've got a PR to attempt to kind-of-fix this in #295. It doesn't address the issue where some values are much longer than a given column assumes, but it does make the column widths easier to tweak, and adjusts some of them to maybe-more-reasonable values. If anyone takes issue with the new values I picked, it will be easy to change since they're all specified at the top of the template instead of spread throughout.

It would be nice to be able to grow/shrink column widths according to the longest/shortest value for that column in a range, but that would have to be implemented as a template helper function, since the go template syntax scopes variables to the control structure they're declared inside of, and we'd have to iterate over range.issues to find the field widths. Maybe I can hack on that next.

@mikepea mikepea closed this as completed in 7e97463 Dec 3, 2019
mikepea added a commit that referenced this issue Dec 3, 2019
add template functions to handle table output, fixes #176, replaces #296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants