andygrunwald / andygrunwald/go-jira

[issue] - Example "Create an Issue" Failing

Đang mở
#308 7 bình luận 2 reaction 0 người được giao Xem trên GitHub
needs triage
Ngôn ngữ chính
Go
Star
1.6k
Fork
500
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## 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.

Screenshot 2020-08-09 at 11 16 05 PM

## 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.

Screenshot 2020-08-10 at 2 00 08 PM

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.