jira-cli
jira-cli copied to clipboard
`jira issue create` fails for classic project
Describe the bug
Please provide following details
- JiraCLI Version:
(Version="0.2.0", GitCommit="06888ef8934a2b95d4a729cc024f11e485239a36", GoVersion="go1.17.2", BuildDate="2021-11-20", Compiler="gc", Platform="darwin/amd64")
- Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
Cloud
- What operating system are you using? Also mention version.
macOS Catalina 10.15.7
- What terminal are you using? Also mention version.
iTerm 2 Build 3.4.12
To Reproduce
Steps to reproduce the behavior:
jira issue create
? Issue type Oppgave
? Summary test
? Description <Received>
? What's next? Submit
⠼ Creating an issue...
Error:
- issuetype: Sakstypen valgt er ugyldig.
The error "Sakstypen valgt er ugyldig" is Norwegian for "Invalid issue type"
Additional context
Here's my .config/.jira/.config.yml generated by jira init:
board:
id: REDACTED
name: REDACTED
type: kanban
config: ""
debug: false
epic:
name: ""
link: ""
installation: Cloud
issue:
types:
- id: "10011"
name: Historie
subtask: false
- id: "10030"
name: Oppgave
subtask: false
- id: "10031"
name: Deloppgave
subtask: true
- id: "10032"
name: Feil
subtask: false
- id: "10000"
name: Epos
subtask: false
login: REDACTED
project:
key: BIBL
type: classic
server: https://REDACTED.atlassian.net/
If I switch to another project, which has type: next-gen, it works to create issues. I only have these two projects to test with.
Hi @danmichaelo does this happen with all issue type in classic project or just this specific one?
Hi @danmichaelo does this happen with all issue type in
classicproject or just this specific one?
Hi @ankitpokhrel , here's a summary:
Historieactually worked 😲Oppgavefailed withissuetype: Sakstypen valgt er ugyldig.Deloppgaverequires a parent task, so I didn't try that.Feilfailed withissuetype: Sakstypen valgt er ugyldig.Eposfailed for another reasoncustomfield_10011: Epic Name kreves.(which I could probably fix by specifying that customfield manually).
@danmichaelo I was not able to reproduce it fully (the behavior was bit unpredictable in my setup 🤷♂️). I made some adjustments based on a hunch though.
Could you please try with new build and let me know how it goes? Since the release is not yet available, you can either compile from source or if you are using homebrew you can build binary from HEAD (requires make, git and go)
brew uninstall jira-cli
brew install jira-cli --HEAD
Cool, thanks, @ankitpokhrel , I tried that:
$ brew uninstall jira-cli
$ brew install jira-cli --HEAD
$ jira version
(Version="main", GitCommit="cd73923197284139b69c7999a54f8873364333d7", CommitDate="2022-01-05T21:19:09+00:00", GoVersion="go1.17.5", Compiler="gc", Platform="darwin/amd64")
but now it panics:
$ jira issue create -p BIBL
panic: interface conversion: interface {} is nil, not string
goroutine 1 [running]:
github.com/ankitpokhrel/jira-cli/internal/cmd/issue/create.(*createCmd).setIssueTypes(0xc0006bfc90)
/private/tmp/jira-cli-20220107-22966-1h9gsd3/internal/cmd/issue/create/create.go:183 +0x499
github.com/ankitpokhrel/jira-cli/internal/cmd/issue/create.create(0xc0005aec80, {0x186d373, 0x2, 0x2})
/private/tmp/jira-cli-20220107-22966-1h9gsd3/internal/cmd/issue/create/create.go:81 +0x1f2
github.com/spf13/cobra.(*Command).execute(0xc0005aec80, {0xc0005a03a0, 0x2, 0x2})
/Users/danmichael/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc0005ae280)
/Users/danmichael/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
main.main()
/private/tmp/jira-cli-20220107-22966-1h9gsd3/cmd/jira/main.go:12 +0x1e
@danmichaelo Sorry I forgot to mention that you need to re-generate the config (jira init). Also, could you please try it with the configured project (without -p). Using -p option might have issue, I first wanted to verify if the change works before looking into other part of the codebase.
Bummer, it helper to re-configure, but then I got the same error from jira issue create:
jira issue create
? Issue type Oppgave
? Summary Test
? Description <Received>
? What's next? Submit
⠦ Creating an issue...
Error:
- issuetype: Sakstypen valgt er ugyldig.
jira: Received unexpected response '400 Bad Request'.
Please check the parameters you supplied and try again.
Let me know if I can collect some more logs somehow!
@danmichaelo Unfortunately I am not able to replicate this in my setup. But looking at your message it seems like the generated config is missing some data. Could you please tell me what is in your config? I think the issue type handle is somehow missing or incorrect in the config generated for your setup.
With correct config data the UI should look like this:
