Group issues per milestone #6178
-
I see I can filter issues per milestone with -m flag at but I don't see any way to group an issue list by milestone (or do any grouping in general of issues, say by some specific flag) I see I can list and manage milestones using but not sure what would be the best path to take in order to generate a listing of issues closed per milestone (those match releases in my specific case) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Good research. Trac milestone systemI guess you are looking for something like this: Trac - Active Tickets By Milestone GitHub cli (gh) issue list with milestones
gh issue list --search "milestone:* sort:updated-desc" --limit 100 \
--repo brave/brave-ios --state all --json milestone,number,state,title,updatedAt \
--template '
{{- $headerColor := "blue+b" -}}
{{- tablerow ("ISSUE" | color $headerColor) ("MILESTONE" | color $headerColor) ("LAST UPDATE" | color $headerColor) ("TITLE" | color $headerColor) -}}
{{- range . -}}
{{- $stateColor := "green" -}}
{{- if eq .state "CLOSED" -}}{{- $stateColor = "red" -}}{{- end -}}
{{- tablerow (printf "#%v" .number | color $stateColor) (.milestone.title | color "cyan+h") (timeago .updatedAt | color "gray+h") .title -}}
{{- end -}}' Demo: List of all issues with a milestone (limited to 100 issues)Demo: List of open issues with a milestone |
Beta Was this translation helpful? Give feedback.
-
Alternatively, go through the milestones in a loop using a small shell function. function milestoneList {
if [ ${#@} -ne 2 ]; then
echo -e "!!! Respect the syntax: $0 OWNER_NAME REPO_NAME"
return 1
fi
MILESTONE_TITLE=()
while IFS='' read -r line; do MILESTONE_TITLE+=("$line"); done < <(gh api -X GET /repos/"$1/$2"/milestones -f sort=due_on -f direction=desc -f state=open --jq '.[] | .title')
for i in "${MILESTONE_TITLE[@]}"; do
echo -n "Milestone $i"
GH_PAGER="cat" gh issue list --milestone "$i" --search "sort:updated-desc" --state open --repo "$1/$2"
echo
done
} |
Beta Was this translation helpful? Give feedback.
-
btw, another way may be by crafting a GraphQL query, but haven't studied the GitHub APIs - https://docs.github.com/en/graphql |
Beta Was this translation helpful? Give feedback.
Alternatively, go through the milestones in a loop using a small shell function.