diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index a6f654c..fac0ccf 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -65,6 +65,12 @@ jobs: external-url: JireRelease=${{ env.REL_LINK }} # kosli-template-file: ${{ env.KOSLI_TEMPLATE_FILE }} + - name: Add trail to jira release + run: | + source scripts/lib-jira.sh + kosli_trail_link="https://app.kosli.com/${{ env.KOSLI_ORG }}/flows/${{ env.KOSLI_FLOW }}/trails/${{ env.RELEASE_ID }}" + add_trail_link_to_release ${{ env.RELEASE_ID }} ${kosli_trail_link} + - name: Report current prod SW run: | source scripts/lib-kosli.sh diff --git a/scripts/lib-jira.sh b/scripts/lib-jira.sh index 6f26d66..351cac2 100755 --- a/scripts/lib-jira.sh +++ b/scripts/lib-jira.sh @@ -196,6 +196,20 @@ function add_section_to_release loud_curl_jira PUT "${url}" "${data}" } +function add_trail_link_to_release +{ + local -r releaseId=$1; shift + local -r trailUrl=$1; + local -r url="${JIRA_BASE_URL}/rest/api/3/version/${releaseId}/relatedwork" + local -r data='{ + "category": "Audit", + "title": "Kosli Trail", + "url": "'${trailUrl}'" + }' + debug_log "Add related work to release ${releaseId}:\n${data}" + loud_curl_jira PUT "${url}" "${data}" +} + # Jira has no API to add an approver to a release. This must be done in the UX # See https://community.developer.atlassian.com/t/add-approver-to-version-through-rest-api/76975 function add_approver_to_release