Open 030 opened 3 years ago
Here's a quick workaround that worked for me:
First, figure out the custom field ID for the Watchers
field
var customFieldID string
fieldList, _, _ := client.Field.GetList()
for _, v := range fieldList {
if v.Name == "Watchers" {
customFieldID = v.ID
break
}
}
Then set the values for that custom field in the Unknowns
map
i := jira.Issue{
Fields: &jira.IssueFields{
Unknowns: map[string]interface{}{
customFieldID: []*jira.Watcher{
{
Name: "cfloody",
},
},
},
Description: description,
Type: jira.IssueType{
Name: "Task",
},
Project: jira.Project{
Key: "Foo",
},
Summary: summary,
Priority: &jira.Priority{
Name: "Low",
},
},
}
Hey @030, did this solve the initial request? If yes, please let us know and it can be added to the example directory.
Hey,
I am very sorry that this issue has been open for a long time with no final solution. We work on this project in our spare time, and sometimes, other priorities take over. This is the typical open source dilemma.
To provide visibility, we created the Road to v2 Milestone and calling for your feedback in https://github.com/andygrunwald/go-jira/issues/489
The development will take some time; however, I hope you can benefit from the changes. If you seek priority development for your issue + you like to sponsor it, please contact me.
We will work on this issue indirectly. This means that during the development phase, we aim to tackle it. Maybe in a different way like it is currently handled. Please understand that this will take a while because we are running this in our spare time.
Thanks for using this library. If there is anything else you would like to tell us, let us know!
Example
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-watchers/#api-rest-api-2-issue-issueidorkey-watchers-post
related
https://github.com/andygrunwald/go-jira/issues/191#issuecomment-771658944