From ee0e780fa414835cd8bff97977249ad9666f68c2 Mon Sep 17 00:00:00 2001 From: Cory Bennett Date: Thu, 21 Jan 2016 17:35:18 -0800 Subject: [PATCH] [issue #28] check to make sure we got back issuetypes for create metadata --- commands.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands.go b/commands.go index 839e5684..860df1ad 100644 --- a/commands.go +++ b/commands.go @@ -233,6 +233,11 @@ func (c *Cli) CmdCreate() error { return err } if val, ok = val.([]interface{})[0].(map[string]interface{})["issuetypes"]; ok { + if len(val.([]interface{})) == 0 { + err = fmt.Errorf("Project '%s' does not support issuetype '%s'. Unable to create issue.", project, issuetype) + log.Error("%s", err) + return err + } issueData["meta"] = val.([]interface{})[0] } }