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

panic creating issue when createmeta returns empty issuetypes #28

Closed
blalor opened this issue Jan 21, 2016 · 4 comments
Closed

panic creating issue when createmeta returns empty issuetypes #28

blalor opened this issue Jan 21, 2016 · 4 comments

Comments

@blalor
Copy link
Contributor

blalor commented Jan 21, 2016

> jira create 
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/Netflix-Skunkworks/go-jira.(*Cli).CmdCreate(0xc820017e00, 0x0, 0x0)
    …/go-jira/src/github.com/Netflix-Skunkworks/go-jira/commands.go:236 +0xfc1
main.main()
    …/go-jira/main/main.go:338 +0x3be5

That corresponds to this line

Running that with a few -vs, I ended up with this:

>jira request '/rest/api/2/issue/createmeta?projectKeys=SYS&issuetypeNames=Bug&expand=projects.issuetypes.fields'
{
    "expand": "projects",
    "projects": [
        {
            "avatarUrls": {
                "16x16": "https://jira.example.com/secure/projectavatar?size=xsmall\u0026avatarId=10011",
                "24x24": "https://jira.example.com/secure/projectavatar?size=small\u0026avatarId=10011",
                "32x32": "https://jira.example.com/secure/projectavatar?size=medium\u0026avatarId=10011",
                "48x48": "https://jira.example.com/secure/projectavatar?avatarId=10011"
            },
            "expand": "issuetypes",
            "id": "10070",
            "issuetypes": [],
            "key": "SYS",
            "name": "Sysadmin",
            "self": "https://jira.example.com/rest/api/2/project/10070"
        }
    ]
}
@blalor
Copy link
Contributor Author

blalor commented Jan 21, 2016

I also get a panic on jira createmeta.

@blalor
Copy link
Contributor Author

blalor commented Jan 21, 2016

Ah, I think this is because "Bug" isn't a valid issuetype for this project.

@coryb
Copy link
Contributor

coryb commented Jan 22, 2016

Interesting, let me get a check for that added.

@coryb
Copy link
Contributor

coryb commented Jan 22, 2016

I pushed out a change for this and published a new release. Hopefully it will at least produce an error message now rather than a panic. Thanks
-Cory

@coryb coryb closed this as completed Jan 22, 2016
pdericson pushed a commit to pdericson/go-jira that referenced this issue Sep 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants