Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add priorities to Jira issues #546

Merged
merged 10 commits into from
Sep 27, 2023
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/[email protected]
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
croyzor marked this conversation as resolved.
Show resolved Hide resolved
uses: atlassian/[email protected]
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 }}"}'