diff --git a/pkg/jira/create.go b/pkg/jira/create.go index 93acd2d9..835ec113 100644 --- a/pkg/jira/create.go +++ b/pkg/jira/create.go @@ -205,6 +205,8 @@ func constructCustomFields(fields map[string]string, data *createRequest) { switch configured.Schema.DataType { case customFieldFormatOption: data.Fields.M.customFields[configured.Key] = customFieldTypeOption{Value: val} + case customFieldFormatProject: + data.Fields.M.customFields[configured.Key] = customFieldTypeProject{Value: val} case customFieldFormatArray: pieces := strings.Split(strings.TrimSpace(val), ",") if configured.Schema.Items == customFieldFormatOption { diff --git a/pkg/jira/customfield.go b/pkg/jira/customfield.go index d7bee5e2..92f3c675 100644 --- a/pkg/jira/customfield.go +++ b/pkg/jira/customfield.go @@ -1,9 +1,10 @@ package jira const ( - customFieldFormatOption = "option" - customFieldFormatArray = "array" - customFieldFormatNumber = "number" + customFieldFormatOption = "option" + customFieldFormatArray = "array" + customFieldFormatNumber = "number" + customFieldFormatProject = "project" ) type customField map[string]interface{} @@ -30,3 +31,11 @@ type customFieldTypeOptionAddRemove struct { Add *customFieldTypeOption `json:"add,omitempty"` Remove *customFieldTypeOption `json:"remove,omitempty"` } + +type customFieldTypeProject struct { + Value string `json:"key"` +} + +type customFieldTypeProjectSet struct { + Set customFieldTypeProject `json:"set"` +} diff --git a/pkg/jira/edit.go b/pkg/jira/edit.go index 76654ce6..36aefd17 100644 --- a/pkg/jira/edit.go +++ b/pkg/jira/edit.go @@ -323,6 +323,8 @@ func constructCustomFieldsForEdit(fields map[string]string, data *editRequest) { switch configured.Schema.DataType { case customFieldFormatOption: data.Update.M.customFields[configured.Key] = []customFieldTypeOptionSet{{Set: customFieldTypeOption{Value: val}}} + case customFieldFormatProject: + data.Update.M.customFields[configured.Key] = []customFieldTypeProjectSet{{Set: customFieldTypeProject{Value: val}}} case customFieldFormatArray: pieces := strings.Split(strings.TrimSpace(val), ",") if configured.Schema.Items == customFieldFormatOption {