go-jira / jira

simple jira command line client in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR Invalid Usage: template: wrong type for value; expected []interface {}; got []string

kvaradhan3 opened this issue · comments

Originally posted by @lvh in #20 (comment)

I have a similar question to the comment about the commit in #20.

I created the following custom-command:

---
custom-commands:
  - name: sprint delete
    help: move issue from active sprint for project
    args:
      - name: ISSUE
        required: true
        repeat: true
    script: |
      {{jira}} req -M POST "/rest/agile/1.0/backlog/issue"  \
          '{"issues":[{{ args.ISSUE | join ","}}]}'

When I run this, I get:

~ ➜ jira sprint delete XYZ-123 
usage: jira sprint delete <ISSUE>...

move issue from active sprint for project

Global flags:
  -h, --help                   Show context-sensitive help (also try --help-long and --help-man).
  -v, --verbose ...            Increase verbosity for debugging
  -e, --endpoint=ENDPOINT      Base URI to use for Jira
  -k, --insecure               Disable TLS certificate verification
  -Q, --quiet                  Suppress output to console
      --unixproxy=UNIXPROXY    Path for a unix-socket proxy
      --socksproxy=SOCKSPROXY  Address for a socks proxy
  -u, --user=USER              user name used within the Jira service
      --login=LOGIN            login name that corresponds to the user used for authentication

Args:
  <ISSUE>

ERROR Invalid Usage: template: gojira:2:37: executing "gojira" at <",">: wrong type for value; expected []interface {}; got []string

so how why does that commit expect an []interface {} and how do I pass it that?

FWIW, my jira versions:

~ ➜ jira version         
development
~ ➜ brew info go-jira        
==> go-jira: stable 1.0.27 (bottled)
Simple jira command-line client in Go
https://github.com/go-jira/jira
/usr/local/Cellar/go-jira/1.0.27 (6 files, 8.8MB) *
  Poured from bottle on 2022-08-04 at 12:22:56