Skip to content

Commit 6c1753f

Browse files
authored
Add trail link as related work to release (#150)
1 parent 9e37fc0 commit 6c1753f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/create-release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ jobs:
6565
external-url: JireRelease=${{ env.REL_LINK }}
6666
# kosli-template-file: ${{ env.KOSLI_TEMPLATE_FILE }}
6767

68+
- name: Add trail to jira release
69+
run: |
70+
source scripts/lib-jira.sh
71+
kosli_trail_link="https://app.kosli.com/${{ env.KOSLI_ORG }}/flows/${{ env.KOSLI_FLOW }}/trails/${{ env.RELEASE_ID }}"
72+
add_trail_link_to_release ${{ env.RELEASE_ID }} ${kosli_trail_link}
73+
6874
- name: Report current prod SW
6975
run: |
7076
source scripts/lib-kosli.sh

scripts/lib-jira.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,20 @@ function add_section_to_release
196196
loud_curl_jira PUT "${url}" "${data}"
197197
}
198198

199+
function add_trail_link_to_release
200+
{
201+
local -r releaseId=$1; shift
202+
local -r trailUrl=$1;
203+
local -r url="${JIRA_BASE_URL}/rest/api/3/version/${releaseId}/relatedwork"
204+
local -r data='{
205+
"category": "Audit",
206+
"title": "Kosli Trail",
207+
"url": "'${trailUrl}'"
208+
}'
209+
debug_log "Add related work to release ${releaseId}:\n${data}"
210+
loud_curl_jira PUT "${url}" "${data}"
211+
}
212+
199213
# Jira has no API to add an approver to a release. This must be done in the UX
200214
# See https://community.developer.atlassian.com/t/add-approver-to-version-through-rest-api/76975
201215
function add_approver_to_release

0 commit comments

Comments
 (0)