Skip to content

Commit

Permalink
[issue #28] check to make sure we got back issuetypes for create meta…
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
coryb committed Jan 22, 2016
1 parent c5fe9f5 commit ee0e780
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down

0 comments on commit ee0e780

Please sign in to comment.