Skip to content

Commit

Permalink
[MM-794]: review fixes
Browse files Browse the repository at this point in the history
Kshitij-Katiyar committed Sep 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 450e202 commit 035c979
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions server/client.go
Original file line number Diff line number Diff line change
@@ -333,28 +333,27 @@ func MakeCreateIssueURL(instance Instance, project *jira.Project, issue *jira.Is
}

// add custom fields
for k, v := range issue.Fields.Unknowns {
switch vTyped := v.(type) {
for key, field := range issue.Fields.Unknowns {
switch fieldTyped := field.(type) {
case string:
q.Add(k, vTyped)
q.Add(key, fieldTyped)
case map[string]interface{}:
if id, ok := vTyped["id"].(string); ok {
q.Add(k, id)
if id, ok := fieldTyped["id"].(string); ok {
q.Add(key, id)
}
case []interface{}:
for _, item1 := range vTyped {
switch vTyped2 := item1.(type) {
for _, element := range fieldTyped {
switch elementTyped := element.(type) {
case string:

q.Add(k, vTyped2)
q.Add(key, elementTyped)
case map[string]interface{}:
if id, ok := vTyped2["id"].(string); ok {
q.Add(k, id)
if id, ok := elementTyped["id"].(string); ok {
q.Add(key, id)
}
case []map[string]interface{}:
for _, item := range vTyped2 {
if id, ok := item["id"].(string); ok {
q.Add(k, id)
for _, mapWithID := range elementTyped {
if id, ok := mapWithID["id"].(string); ok {
q.Add(key, id)
}
}
}

0 comments on commit 035c979

Please sign in to comment.