andygrunwald / andygrunwald/go-jira

nil pointer exception for custom field not defined

未关闭
#322 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
needs triage
主要语言
Go
星标
1.6k
派生
500
PR 合并指标
30 天内没有已合并 PR

描述

## Describe the bug

When setting up a project with custom fields, getting a field with Unknowns generate nil pointer exception if the custom field is not defined in JIRA

## To Reproduce

- Create a custom field in JIRA of type "number"
- Do not configure it on one ticket
- Get the value
```
v, err := issue.Fields.Unknowns.MarshalMap(fmt.Sprintf("customfield_%d", fieldID))
```

## Expected behavior

The value is correctly returned

## Possible Solution

I will create a PR as I have found the root cause

## Your Environment

Include as many relevant details about the environment you experienced the problem in

* go-jira version (git tag or sha): v1.12.0
* Go version (`go version`): 1.14
* Jira version: v8.12.0
* Jira type (cloud or on-premise): on-premise
* Involved Jira plugins: no
* Operating System and version: MAC OS X

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。