Skip to content

Commit 82ea728

Browse files
authored
[Chore] Add user mapping for Jira account ID in workflow
1 parent 37bf817 commit 82ea728

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

.github/workflows/create-jira-issue.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ jobs:
3535
echo '${{ steps.issue-parser.outputs.__ticket_number }}'
3636
echo '${{ steps.issue-parser.outputs.jsonString }}'
3737
38+
- name: Map GitHub user to Jira Account ID
39+
id: user-map
40+
if: github.event.issue.assignees[0] != null
41+
run: |
42+
ASSIGNEE_LOGIN="${{ github.event.issue.assignees[0].login }}"
43+
JIRA_ACCOUNT_ID=""
44+
if [[ "$ASSIGNEE_LOGIN" == "sangyup12" ]]; then
45+
JIRA_ACCOUNT_ID="712020:c34fc89a-5eba-4fb8-80d7-952df9c07444?cloudId=10784225-1720-490f-b7c2-871dd37920fc"
46+
elif [[ "$ASSIGNEE_LOGIN" == "Yeonnies" ]]; then
47+
JIRA_ACCOUNT_ID="712020:e9701a7b-fc97-4a87-9a60-331acc570dbe?cloudId=10784225-1720-490f-b7c2-871dd37920fc"
48+
elif [[ "$ASSIGNEE_LOGIN" == "OneTen19" ]]; then
49+
JIRA_ACCOUNT_ID="712020:aca95733-91c2-4f43-9b27-6bd3e65987e5?cloudId=10784225-1720-490f-b7c2-871dd37920fc"
50+
fi
51+
echo "ACCOUNT_ID=$JIRA_ACCOUNT_ID" >> $GITHUB_OUTPUT
52+
3853
- name: Convert markdown to Jira Syntax
3954
uses: peter-evans/jira2md@v1
4055
id: md2jira
@@ -46,7 +61,27 @@ jobs:
4661
${{ github.event.issue.body }}
4762
mode: md2jira
4863

49-
- name: Create Issue
64+
- name: Create Issue with Assignee
65+
if: steps.user-map.outputs.ACCOUNT_ID != ''
66+
id: create
67+
uses: atlassian/gajira-create@v3
68+
with:
69+
project: SCRUM
70+
issuetype: Subtask
71+
summary: '${{ github.event.issue.title }}'
72+
description: '${{ steps.md2jira.outputs.output-text }}'
73+
fields: |
74+
{
75+
"parent": {
76+
"key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}"
77+
},
78+
"assignee": {
79+
"accountId": "${{ steps.user-map.outputs.ACCOUNT_ID }}"
80+
}
81+
}
82+
83+
- name: Create Issue without Assignee
84+
if: steps.user-map.outputs.ACCOUNT_ID == ''
5085
id: create
5186
uses: atlassian/gajira-create@v3
5287
with:

0 commit comments

Comments
 (0)