Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions .github/scripts/create_jira_ticket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,28 @@ url_encode() {
encoded_jira_ticket_title=$(url_encode "${JIRA_TICKET_TITLE:?}")
echo "encoded_jira_ticket_title: ${encoded_jira_ticket_title}"

found_issue=$(curl --request GET \
found_issue_response=$(curl --request GET \
--url 'https://jira.mongodb.org/rest/api/2/search?jql=project=10984%20AND%20issuetype=12%20AND%20component=35986%20AND%20summary~"'"${encoded_jira_ticket_title:?}"'"' \
--header 'Authorization: Bearer '"${JIRA_API_TOKEN:?}" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' | jq .total)
--header 'Content-Type: application/json')

echo "found_issue_response: ${found_issue_response}"

found_issue=$(echo "${found_issue_response}" | jq .total)
echo "found_issue: ${found_issue}"
if [ "$found_issue" -ne 0 ]; then
echo "There is already a Jira ticket with the title \"${JIRA_TICKET_TITLE:?}\""
echo "No new Jira ticket will be created."
exit 0
fi

if [ "${found_issue}" == "null" ]; then
echo "There was an error in retrieving the jira ticket: ${found_issue_response}"
echo "No new Jira ticket will be created."
exit 1
fi

echo "Creating Jira ticket...."
echo "JIRA_TICKET_TITLE: ${JIRA_TICKET_TITLE}"
echo "JIRA_TICKET_DESCRIPTION: ${JIRA_TICKET_DESCRIPTION}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-versions-reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
if: steps.retrieve-sunset-apis.outputs.hash_code_sunset_apis != null
env:
JIRA_API_TOKEN: ${{ secrets.jira_api_token }}
JIRA_TICKET_TITLE: "[API Platform] Some APIs are approaching their sunset date in the next 3 months. ID: ${{steps.retrieve-sunset-apis.outputs.hash_code_sunset_apis}}"
JIRA_TICKET_TITLE: "Some APIs are approaching their sunset date in the next 3 months. ID: ${{steps.retrieve-sunset-apis.outputs.hash_code_sunset_apis}}"
run: |
sunset_apis=$(sed 's/"/\\"/g' sunset_apis.json)
JIRA_TICKET_DESCRIPTION="The following APIs will be sunset in the next 3 months. Please follow our [wiki|https://wiki.corp.mongodb.com/display/MMS/API+eXperience+Production+Checklist#APIeXperienceProductionChecklist-APISunsetActionItems]. {noformat}${sunset_apis}{noformat}"
Expand Down
Loading