Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Fields not optional during issue create? #300

Closed
1 of 5 tasks
mavjsh opened this issue Aug 8, 2024 · 1 comment · Fixed by #302
Closed
1 of 5 tasks

Custom Fields not optional during issue create? #300

mavjsh opened this issue Aug 8, 2024 · 1 comment · Fixed by #302
Assignees
Labels
bug Something isn't working

Comments

@mavjsh
Copy link

mavjsh commented Aug 8, 2024

go-atlassian version
main

go-atlassian component

  • Jira Software Cloud
  • Jira Agile Cloud
  • Jira Service Management Cloud
  • Confluence Cloud
  • Atlassian Admin Cloud

Describe the bug 🐛
In the docs it states that custom fields are optional(https://docs.go-atlassian.io/cookbooks/create-jira-issue#step-5-custom-fields-definition). But this(

return nil, ErrNoCustomFieldError
) returns an error if you pass an empty CustomFields{} struct. The docs don't explain how to do this optionally.

To Reproduce 🚧
```
payload := &jiramodels.IssueSchemeV2{
Fields: &jiramodels.IssueFieldsSchemeV2{
Summary: summary,
Project: &jiramodels.ProjectScheme{ID: "10000"},
IssueType: &jiramodels.IssueTypeScheme{Name: "Story"},
Description: description,
},
}

var customFields = jiramodels.CustomFields{}

_, _, err := atlassian.Issue.Create(context.Background(), payload, &customFields)
if err != nil {
	log.Fatal(err)
}

**Expected behavior** :white_check_mark: 
I expect the issue to create.
**Screenshots** :page_facing_up: 
"no custom-fields set"
**Additional context**

**Code snippet**
@mavjsh mavjsh added the bug Something isn't working label Aug 8, 2024
@ctreminiom ctreminiom linked a pull request Aug 11, 2024 that will close this issue
@ctreminiom
Copy link
Owner

Hi @mavjsh,

Thank you for investing time in this project!.

I just created the PR: #302 that fixes that error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants