Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding ability to handle bulletpoints from jira api response #267

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions scripts/release/release-notes-onprem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,19 @@ if [ -n "$IS_RELEASE" ]; then
echo "Done."
fi


jira_parse_content() {
local content=$1
local type=$(echo $content | jq -r '.fields.customfield_11009.content[].type')

case $type in
"paragraph")
echo $content | jq -r '.fields.customfield_11009.content[].content[].text'
;;
"bulletList")
echo $content | jq -r '[.fields.customfield_11009.content[].content[].content[].content[] | .text] | join(", ")'
;;
esac
}
####################
# Find all related tickets
####################
Expand Down Expand Up @@ -130,16 +142,16 @@ for i in $(git log $PROD_TAG...$DEV_TAG | grep -Eo '(PACT-|CC-)([0-9]+)' | sort
fi

release_type=$(echo $response | jq '.fields.customfield_18528.value' | tr -d '"')
has_note=$(echo $response | jq '.fields.customfield_11009' | tr -d '"')
ticket_note=$(echo $response | jq '.fields.customfield_11009' | tr -d '"')

note="null"
if [ "$has_note" != "null" ]; then
note=$(echo $response | jq '.fields.customfield_11009.content[].content[].text' | tr -d '"')
if [ "$ticket_note" != "null" ]; then
note=$(jira_parse_content $response)
fi

if [ "$release_type" = "Feature" ] && [ "$has_note" != "null" ] && [ "$note" != "null" ]; then
if [ "$release_type" = "Feature" ] && [ "$ticket_note" != "null" ] && [ "$note" != "null" ]; then
features+="\n* "$note
elif [ "$release_type" = "Fix" ] && [ "$has_note" != "null" ] && [ "$note" != "null" ]; then
elif [ "$release_type" = "Fix" ] && [ "$ticket_note" != "null" ] && [ "$note" != "null" ]; then
fixes+="\n* "$note
fi

Expand Down