|
35 | 35 | echo '${{ steps.issue-parser.outputs.__ticket_number }}' |
36 | 36 | echo '${{ steps.issue-parser.outputs.jsonString }}' |
37 | 37 |
|
| 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 | +
|
38 | 53 | - name: Convert markdown to Jira Syntax |
39 | 54 | uses: peter-evans/jira2md@v1 |
40 | 55 | id: md2jira |
|
46 | 61 | ${{ github.event.issue.body }} |
47 | 62 | mode: md2jira |
48 | 63 |
|
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 == '' |
50 | 85 | id: create |
51 | 86 | uses: atlassian/gajira-create@v3 |
52 | 87 | with: |
|
0 commit comments