andygrunwald / andygrunwald/go-jira
Error while creating jira story
- 主要语言
- Go
- 星标
- 1.6k
- 派生
- 500
- PR 合并指标
- 30 天内没有已合并 PR
描述
2021/05/11 16:41:09 ERROR: request failed. Please analyze the request body for more details. Status code: 400
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1271f8d]
goroutine 1 [running]:
main.main()
/Users/Documents/jiratrial.go:44 +0x3ad
exit status 2
```
package main
import (
"fmt"
jira "github.com/andygrunwald/go-jira"
"log"
)
func main() {
base := "https://jira.com"
tp := jira.BasicAuthTransport{
Username: "",
Password: "",
}
jiraClient, err := jira.NewClient(tp.Client(), base)
if err != nil {
log.Println(err)
}
i := jira.Issue{
Fields: &jira.IssueFields{
Assignee: &jira.User{
AccountID: "",
},
Reporter: &jira.User{
AccountID: "",
},
Description: "Test Issue",
Type: jira.IssueType{
Name: "Story",
},
Project: jira.Project{
Key: "ABC",
},
Summary: "Just a demo issue",
},
}
issue, _, err := jiraClient.Issue.Create(&i)
if err != nil {
log.Println("ERROR: ", err)
}
fmt.Printf("%s: %+v\n", issue.Key, issue.Fields.Summary)
fmt.Println(issue)
}
```
getting an error while running this piece of code
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。