andygrunwald / andygrunwald/go-jira
Custom fields not being written, and creating issues returns an incorrect *jira.Issue with nil fields
- Langage dominant
- Go
- Étoiles
- 1.6k
- Forks
- 500
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## Describe the bug
I'm on Jira Cloud trying to create new issues with custom fields. I have the following code, and the custom field is not getting written. Additionally, the createdIssue has a nil value for Fields, even though in the UI, the other specified fields minus the custom fields are getting written.
```
newIssue := jira.Issue{
Fields: &jira.IssueFields{
Summary: oldIssue.Fields.Summary,
Description: oldIssue.Fields.Description,
Project: jira.Project{
Key: "NEWBOARD",
},
Type: jira.IssueType{
Name: "NEWTYPE",
},
Assignee: oldIssue.Fields.Assignee,
Duedate: oldIssue.Fields.Duedate,
Unknowns: tcontainer.MarshalMap{
"customfield_11228": 1386,
},
},
}
createdIssue, resp, err := c.JClient.Issue.Create(&newIssue)
```
## To Reproduce
Adding
```Unknowns: tcontainer.MarshalMap{
"customfield_11228": 1386,
},
```
to https://sourcegraph.com/github.com/andygrunwald/go-jira/-/blob/examples/createwithcustomfields/main.go should be reproduceable.
## Expected behavior
I expect this custom field to be written and visible in the UI. I also expect the returned *jira.Issue (createdIssue in the above example) to reflect the issue that was created, i.e. not having a nil value for the Fields.
## Your Environment
Jira Cloud
github.com/andygrunwald/go-jira v1.13.0
github.com/trivago/tgo v1.0.7
## Additional context
I am migrating tickets from one board to another. Because of the custom fields, I need to create new issues in the new project, but I am blocked on being unable to write the custom fields.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.