Closed juandspy closed 1 year ago
@juandspy Thanks for raising the PR! Do you know what causes a sprint to come back as type string as opposed to map? Does this correspond to a particular issue type in Jira?
@juandspy Thanks for raising the PR! Do you know what causes a sprint to come back as type string as opposed to map? Does this correspond to a particular issue type in Jira?
@cbruno10 I've added some logging in there:
if sprint, ok := item.(map[string]interface{}); ok {
sprintNames = append(sprintNames, sprint["name"])
} else {
plugin.Logger(ctx).Debug("extractSprintNames", fmt.Sprintf("Wrong type of sprint found. Type is %v, value is %v", reflect.TypeOf(sprint), sprint))
}
and found out that there are some empty maps:
2023-08-09 07:37:52.954 UTC [DEBUG] steampipe-plugin-jira.plugin: [DEBUG] 1691566672787: extractSprintNames: EXTRA_VALUE_AT_END="Wrong type of sprint found. Type is map[string]interface {}, value is map[]"
@juandspy In Jira itself, do you know what types of issues would cause the API/SDK to return them as empty maps instead of strings? Or do you think this is just an SDK issue?
I think we can handle the different data types like you have in this PR, but it would be good to know the root cause of why there are multiple data types coming back.
plugin.Logger(ctx).Debug("extractSprintNames", fmt.Sprintf("Wrong type of sprint found. Type is %v, value is %v", reflect.TypeOf(sprint), sprint))
@cbruno10 it looks like this happens for issues that have no sprints defined f.e
If the issue has at least 1 sprint this doesn't happen
Thanks for the info @juandspy ! Change LGTM
There is an error with some queries because the Jira issue contains a
string
sprint instead of a map:These changes ignore invalid types such as
string
and just store the valid values.