Skip to content

Commit

Permalink
chore: cleaning up how notes are added to release
Browse files Browse the repository at this point in the history
Jira Ticket: [PACT-795]

Jira Ticket: [PACT-795]
  • Loading branch information
Ilia committed Aug 7, 2023
1 parent 9abb9a2 commit f6a530e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/release/release-notes-onprem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ for i in $(git log $PROD_TAG...$DEV_TAG | grep -Eo '(PACT-|CC-)([0-9]+)' | sort
--user "$JIRA_AUTH" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json')

# Valid Scenario: We may have merged code for a ticket that has not been marked as done in Jira since there is
# more work required to complete it but we still want to attach a version to the ticket which tells Jira that
# part of the code has been released to production.
Expand All @@ -126,10 +126,15 @@ for i in $(git log $PROD_TAG...$DEV_TAG | grep -Eo '(PACT-|CC-)([0-9]+)' | sort
release_type=$(echo $response | jq '.fields.customfield_18528.value' | tr -d '"')
has_note=$(echo $response | jq '.fields.customfield_11009' | tr -d '"')

if [ "$release_type" = "Feature" ] && [ "$has_note" != "null" ]; then
features+="\n* "$(echo $response | jq '.fields.customfield_11009.content[].content[].text' | tr -d '"')
elif [ "$release_type" = "Fix" ] && [ "$has_note" != "null" ]; then
fixes+="\n* "$(echo $response | jq '.fields.customfield_11009.content[].content[].text' | tr -d '"')
note="null"
if [ "$has_note" != "null" ]; then
note=$(echo $response | jq '.fields.customfield_11009.content[].content[].text' | tr -d '"')
fi

if [ "$release_type" = "Feature" ] && [ "$has_note" != "null" ] && [ "$note" != "null" ]; then
features+="\n* "$note
elif [ "$release_type" = "Fix" ] && [ "$has_note" != "null" ] && [ "$note" != "null" ]; then
fixes+="\n* "$note
else
review+='\n- https://smartbear.atlassian.net/browse/'$i
fi
Expand Down

0 comments on commit f6a530e

Please sign in to comment.