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 req with template #177

Open
vanniktech opened this issue May 7, 2018 · 1 comment
Open

Jira req with template #177

vanniktech opened this issue May 7, 2018 · 1 comment

Comments

@vanniktech
Copy link
Contributor

I've got the following custom command:

custom-commands:
  - name: sprint-information
    help: show information of the active sprint for project
    script: |
      board_id=$({{jira}} req "/rest/agile/1.0/board?projectKeyOrId=$JIRA_PROJECT" --gjq values.0.id)
      {{jira}} req "/rest/agile/1.0/board/$board_id/sprint?state=active" --gjq values.0

When executing jira sprint-information I get the following output:

{
            "endDate": "2018-05-25T13:00:00.000Z",
            "goal": "Some goal",
            "id": 755,
            "name": "Some name",
            "originBoardId": 96,
            "self": "https://foo.atlassian.net/rest/agile/1.0/sprint/755",
            "startDate": "2018-05-07T09:28:28.027Z",
            "state": "active"
        }

I would expect that when slamming --template table onto it I'd get the json displayed as a nice table.

-{{jira}} req "/rest/agile/1.0/board/$board_id/sprint?state=active" --gjq values.0
+{{jira}} req "/rest/agile/1.0/board/$board_id/sprint?state=active" --gjq values.0 --template table

That's not the case though. I'm still getting the normal JSON printed out. Is there any special configuration I need to do?

@coryb
Copy link
Contributor

coryb commented May 18, 2018

The table template is very specific to the list results. It will not apply generically to any results. I am actually surprised -t table works at all, I would expect it to just abort when the structure does not match the expected format. The default template is request which really is just a json dump:

{{ . | toJson}}

We dont have a generic way to print tabular data, but I will see if anything comes to mind when when I get to looking into #176 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants