Skip to content

How do i access custom fields in v3.Issue.Get #209

Answered by ctreminiom
Fank asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Fank,

There're some helpers on the model package that extract the customfield information based on the customfield type

issue, response, err := atlassian.Issue.Get(context.Background(), "KP-23", nil, []string{"transitions"})
if err != nil {
	log.Fatal(err)
}

fmt.Println(issue.Key)
fmt.Println(response.Status)

options, err := models.ParseMultiSelectCustomField(response.Bytes, "customfield_10046")
if err != nil {
	log.Fatal(err)
}

for _, option := range options {
	fmt.Println(option.ID, option.Value)
}

cascading, err := models.ParseCascadingSelectCustomField(response.Bytes, "customfield_10045")
if err != nil {
	log.Fatal(err)
}

fmt.Println(cascading.Value, cascading.Child.Value)

u…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ctreminiom
Comment options

Answer selected by Fank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants