Skip to content

SNOW-2881614: \" \' test \' \" bash #534

SNOW-2881614: \" \' test \' \" bash

SNOW-2881614: \" \' test \' \" bash #534

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 }}
run: |
JIRA_API_URL="${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/${ISSUE_KEY}/transitions"
curl -X POST \
--url "$JIRA_API_URL" \
--user "${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.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\" }
}"