go-atlassian icon indicating copy to clipboard operation
go-atlassian copied to clipboard

Added Raw custom field function to add custom structs to fields

Open Fank opened this issue 7 months ago • 0 comments

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post

I wanted to add timetracking to fields, and did not found a function for it so i added Raw to add a custom defined type to jira fields. From the example:

    "timetracking": {
      "originalEstimate": "10",
      "remainingEstimate": "5"
    },

How I use it:

fields.Raw("timetracking", map[string]any{
	"originalEstimate": fmt.Sprintf("%.0fm", position.OrderOriginalEstimate),
}),

Personally I would prefer a typed variation, but I did not find any kind of information about it. But to provide the ability to define it, I decided to go for a Raw function which can handle any type.

Fank avatar Jun 27 '24 06:06 Fank