andygrunwald / andygrunwald/go-jira
[issue] - Example "Create an Issue" Failing
- 主要语言
- Go
- 星标
- 1.6k
- 派生
- 500
- PR 合并指标
- 30 天内没有已合并 PR
描述
## Describe the bug
The example on "Create an Issue" runs into a panic with a status code: `400`.
Formatting tips: GitHub supports Markdown: https://guides.github.com/features/mastering-markdown/
## To Reproduce
Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include configuration, logs, etc. to reproduce, if relevant.
1. Simply copy the example from the README of the repository and paste it into an editor.
2. Run the build to produce a target binary.
3. Execute the target binary and you will be presented with the error seen below.

## Expected behavior
The expected behavior should be that it creates the ticket and exits the program successfully.
## Possible Solution
Removing the `Reporter` and `Assignee` field from the `IssueFields` creates the ticket as expected but another situation occurs. Apparently dereferencing the pointers from `issue` to `i` in the print statement causes another `panic: runtime error: invalid memory address or nil pointer dereference` as seen below.

Changing `issues.Fields.Summary` to `i.Fields.Summary` gets the entire example to be working as expected.
## Your Environment
Include as many relevant details about the environment you experienced the problem in
* go-jira version (git tag or sha): de60bbe
* Go version (`go version`): go1.14.6 darwin/amd64
* Jira version: I believe it is the latest since I can't seem to get the version tag off "Inspect Element"
* Jira type (cloud or on-premise): Cloud
* Involved Jira plugins: None
* Operating System and version: Mac OS
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。