Skip to content

Test issue

Test issue #145

Workflow file for this run

name: New issue
on:
issues:
types: [opened]
jobs:
jira_task:
name: Create Jira issue
runs-on: ubuntu-22.04
steps:
- name: Login
uses: atlassian/gajira-login@v3.0.1
env:
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') }}
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"], "priority": "${{ env.JIRA_PRIORITY }}"}'
- name: Create Task
uses: atlassian/gajira-create@v3.0.1
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"], "priority": "${{ env.JIRA_PRIORITY }}"}'