mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-07-17 01:12:24 +02:00
Add the "option" field type for custom fields
JIRA supports SelectList field types, which are similar to but represented not quite the same as Strings. This change allows go-jira to create issues with custom fields on them that are SelectLists.
This commit is contained in:
committed by
Andreas Fuchs
parent
320d02c202
commit
967e2d4805
10
issue.go
10
issue.go
@ -312,6 +312,12 @@ type TransitionPayload struct {
|
||||
ID string `json:"id" structs:"id"`
|
||||
}
|
||||
|
||||
// Option represents an option value in a SelectList or MultiSelect
|
||||
// custom issue field
|
||||
type Option struct {
|
||||
Value string `json:"value" structs:"value"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON will transform the JIRA time into a time.Time
|
||||
// during the transformation of the JIRA JSON response
|
||||
func (t *Time) UnmarshalJSON(b []byte) error {
|
||||
@ -775,6 +781,10 @@ func InitIssueWithMetaAndFields(metaProject *MetaProject, metaIssuetype *MetaIss
|
||||
issueFields.Unknowns[jiraKey] = IssueType{
|
||||
Name: value,
|
||||
}
|
||||
case "option":
|
||||
issueFields.Unknowns[jiraKey] = Option{
|
||||
Value: value,
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("Unknown issue type encountered: %s for %s", valueType, key)
|
||||
}
|
||||
|
Reference in New Issue
Block a user