Skip to content

Commit e376b0b

Browse files
feat(jira): add JIRA_SKIP_UNPARSEABLE_ISSUES to skip unparseable issue pages
When a Jira issue page returns a successful (2xx) status but a body that cannot be parsed as JSON (e.g. a truncated/partial response), collectIssues currently fails the entire subtask and aborts the whole Jira collection. This adds an opt-in config JIRA_SKIP_UNPARSEABLE_ISSUES that, when true, logs a warning and skips the unparseable page so the rest of the collection can finish. Default behaviour (false) is unchanged. Signed-off-by: Murad-Suleymanov <muradsuleymanov868@gmail.com>
1 parent f2de2dc commit e376b0b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

backend/plugins/jira/tasks/issue_collector.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ func CollectIssues(taskCtx plugin.SubTaskContext) errors.Error {
135135
}
136136
err = json.Unmarshal(blob, &data)
137137
if err != nil {
138+
// By default surface the error so it's visible. Set JIRA_SKIP_UNPARSEABLE_ISSUES=true
139+
// to skip unparseable pages instead of failing the collection.
140+
if taskCtx.GetConfigReader().GetBool("JIRA_SKIP_UNPARSEABLE_ISSUES") {
141+
logger.Warn(err, "skipping unparseable Jira issue page")
142+
return nil, nil
143+
}
138144
return nil, errors.Convert(err)
139145
}
140146
return data.Issues, nil

0 commit comments

Comments
 (0)