Skip to content

Commit

Permalink
add textarea custom field
Browse files Browse the repository at this point in the history
  • Loading branch information
sancyx committed Aug 23, 2024
1 parent eb0e7aa commit eb27f4d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ctreminiom/go-atlassian
module github.com/sancyx/go-atlassian

go 1.14

Expand Down
20 changes: 20 additions & 0 deletions pkg/infra/models/jira_custom_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,26 @@ func (c *CustomFields) Text(customFieldID, textValue string) error {
return nil
}

func (c *CustomFields) TextArea(customFieldID string, textAreaValue *CommentNodeScheme) error {

if len(customFieldID) == 0 {
return ErrNoFieldIDError
}

if textAreaValue == nil {
return ErrNoTextTypeError
}

var fieldNode = map[string]interface{}{}
fieldNode[customFieldID] = textAreaValue

var fieldsNode = map[string]interface{}{}
fieldsNode["fields"] = fieldNode

c.Fields = append(c.Fields, fieldsNode)
return nil
}

// DateTime adds a datetime custom field to the collection.
func (c *CustomFields) DateTime(customFieldID string, dateValue time.Time) error {

Expand Down

0 comments on commit eb27f4d

Please sign in to comment.