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 issue create fails for classic project #231

Open
danmichaelo opened this issue Dec 16, 2021 · 7 comments
Open

jira issue create fails for classic project #231

danmichaelo opened this issue Dec 16, 2021 · 7 comments

Comments

@danmichaelo
Copy link
Contributor

Describe the bug

Please provide following details

  1. JiraCLI Version:
(Version="0.2.0", GitCommit="06888ef8934a2b95d4a729cc024f11e485239a36", GoVersion="go1.17.2", BuildDate="2021-11-20", Compiler="gc", Platform="darwin/amd64")
  1. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
Cloud
  1. What operating system are you using? Also mention version.
macOS Catalina 10.15.7
  1. 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.

@ankitpokhrel
Copy link
Owner

Hi @danmichaelo does this happen with all issue type in classic project or just this specific one?

@danmichaelo
Copy link
Contributor Author

danmichaelo commented Dec 16, 2021

Hi @danmichaelo does this happen with all issue type in classic project or just this specific one?

Hi @ankitpokhrel , here's a summary:

  • Historie actually worked 😲
  • Oppgave failed with issuetype: Sakstypen valgt er ugyldig.
  • Deloppgave requires a parent task, so I didn't try that.
  • Feil failed with issuetype: Sakstypen valgt er ugyldig.
  • Epos failed for another reason customfield_10011: Epic Name kreves. (which I could probably fix by specifying that customfield manually).

@ankitpokhrel
Copy link
Owner

@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

@danmichaelo
Copy link
Contributor Author

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

@ankitpokhrel
Copy link
Owner

@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.

@danmichaelo
Copy link
Contributor Author

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!

@ankitpokhrel
Copy link
Owner

@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:

Screen Shot 2022-01-08 at 12 05 32 PM

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