Skip to content

Commit e8e7498

Browse files
committed
fix: --show-all-issues should preserve user JQL filter
When using --show-all-issues with jira sprint list, the flag now preserves any user-specified JQL filter by combining it with "project IS NOT EMPTY" using AND, rather than replacing it. Closes #969
1 parent 396933d commit e8e7498

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

internal/cmd/sprint/list/list.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ func singleSprintView(sprintQuery *query.Sprint, flags query.FlagParser, boardID
102102
return nil, err
103103
}
104104
if sprintQuery.Params().ShowAllIssues {
105-
q.Params().JQL = "project IS NOT EMPTY"
105+
if q.Params().JQL != "" {
106+
q.Params().JQL = "project IS NOT EMPTY AND " + q.Params().JQL
107+
} else {
108+
q.Params().JQL = "project IS NOT EMPTY"
109+
}
106110
}
107111
resp, err := client.SprintIssues(sprintID, q.Get(), q.Params().From, q.Params().Limit)
108112
if err != nil {
@@ -271,7 +275,11 @@ func getIssueQuery(project string, flags query.FlagParser, showAll bool) (string
271275
return "", err
272276
}
273277
if showAll {
274-
q.Params().JQL = "project IS NOT EMPTY"
278+
if q.Params().JQL != "" {
279+
q.Params().JQL = "project IS NOT EMPTY AND " + q.Params().JQL
280+
} else {
281+
q.Params().JQL = "project IS NOT EMPTY"
282+
}
275283
}
276284
return q.Get(), nil
277285
}

0 commit comments

Comments
 (0)