Skip to content

Commit cbb63be

Browse files
Update jira_close.yml (#603)
1 parent def4070 commit cbb63be

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

.github/workflows/jira_close.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,36 @@ jobs:
88
close-issue:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v4
13-
with:
14-
persist-credentials: false
15-
repository: snowflakedb/gh-actions
16-
ref: jira_v1
17-
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets
18-
path: .
19-
- name: Jira login
20-
uses: atlassian/gajira-login@v3
21-
env:
22-
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
23-
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
24-
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
2511
- name: Extract issue from title
2612
id: extract
2713
env:
2814
TITLE: "${{ github.event.issue.title }}"
2915
run: |
3016
jira=$(echo -n $TITLE | awk '{print $1}' | sed -e 's/://')
3117
echo ::set-output name=jira::$jira
32-
- name: Close issue
33-
uses: ./jira/gajira-close
18+
19+
- name: Close Jira Issue
3420
if: startsWith(steps.extract.outputs.jira, 'SNOW-')
35-
with:
36-
issue: "${{ steps.extract.outputs.jira }}"
21+
run: |
22+
ISSUE_KEY="${{ steps.extract.outputs.jira }}"
23+
JIRA_API_URL="${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/${ISSUE_KEY}/transitions"
24+
25+
curl -X POST \
26+
--url "$JIRA_API_URL" \
27+
--user "${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}" \
28+
--header "Content-Type: application/json" \
29+
--data "{
30+
\"update\": {
31+
\"comment\": [
32+
{ \"add\": { \"body\": \"Closed on GitHub\" } }
33+
]
34+
},
35+
\"fields\": {
36+
\"customfield_12860\": { \"id\": \"11506\" },
37+
\"customfield_10800\": { \"id\": \"-1\" },
38+
\"customfield_12500\": { \"id\": \"11302\" },
39+
\"customfield_12400\": { \"id\": \"-1\" },
40+
\"resolution\": { \"name\": \"Done\" }
41+
},
42+
\"transition\": { \"id\": \"71\" }
43+
}"

0 commit comments

Comments
 (0)