Skip to content

SNOW-2884897: test issue #178

SNOW-2884897: test issue

SNOW-2884897: test issue #178

Workflow file for this run

name: Jira closure
on:
issues:
types: [closed, deleted]
jobs:
close-issue:
runs-on: ubuntu-latest
steps:
- name: Extract issue from title
id: extract
env:
TITLE: '${{ github.event.issue.title }}'
run: |
jira=$(echo -n $TITLE | awk '{print $1}' | sed -e 's/://')
echo ::set-output name=jira::$jira
- name: Close Jira Issue
if: startsWith(steps.extract.outputs.jira, 'SNOW-')
env:
ISSUE_KEY: ${{ steps.extract.outputs.jira }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
run: |
JIRA_API_URL="${JIRA_BASE_URL}/rest/api/2/issue/${ISSUE_KEY}/transitions"
curl -X POST \
--url "$JIRA_API_URL" \
--user "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"update\": {
\"comment\": [
{ \"add\": { \"body\": \"Closed on GitHub\" } }
]
},
\"fields\": {
\"customfield_12860\": { \"id\": \"11506\" },
\"customfield_10800\": { \"id\": \"-1\" },
\"customfield_12500\": { \"id\": \"11302\" },
\"customfield_12400\": { \"id\": \"-1\" },
\"resolution\": { \"name\": \"Done\" }
},
\"transition\": { \"id\": \"71\" }
}"