Skip to content

Commit

Permalink
chore: Add priorities to Jira issues (#546)
Browse files Browse the repository at this point in the history
Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
  • Loading branch information
croyzor and aborgna-q committed Sep 27, 2023
1 parent af664e3 commit b2812b3
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,51 @@ jobs:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Parse the priority label into a Jira priority
id: set_priority_var
env:
LABELS: ${{ github.event.issue.labels.*.name }}
run: |
MY_RESULT=""
for label in $LABELS
do
case $label in
P-low)
MY_RESULT=Low
break;;
P-medium)
MY_RESULT=Medium
break;;
P-high)
MY_RESULT=High
break;;
P-critical)
MY_RESULT=Highest
break;;
esac
done
echo "JIRA_PRIORITY=$MY_RESULT" >> $GITHUB_OUTPUT
- name: Create Bug
uses: atlassian/gajira-create@v3.0.1
if: "contains(github.event.issue.labels.*.name, 'bug')"
if: ${{ contains(github.event.issue.labels.*.name, 'bug') }}
env:
JIRA_PRIORITY: ${{ steps.set_priority_var.outputs.JIRA_PRIORITY }}
with:
project: TKET
issuetype: Bug
summary: « [hugr] ${{ github.event.issue.title }}»
description: ${{ github.event.issue.html_url }}
fields: '{"labels": ["hugr"]}'
fields: '{"labels": ["hugr"], "priority": "${{ env.JIRA_PRIORITY }}"}'

- name: Create Task
uses: atlassian/gajira-create@v3.0.1
if: "! contains(github.event.issue.labels.*.name, 'bug')"
if: ${{ ! contains(github.event.issue.labels.*.name, 'bug') }}
env:
JIRA_PRIORITY: ${{ steps.set_priority_var.outputs.JIRA_PRIORITY }}
with:
project: TKET
issuetype: Task
summary: « [hugr] ${{ github.event.issue.title }}»
description: ${{ github.event.issue.html_url }}
fields: '{"labels": ["hugr"]}'
fields: '{"labels": ["hugr"], "priority": "${{ env.JIRA_PRIORITY }}"}'

0 comments on commit b2812b3

Please sign in to comment.