How to make JIRA issues refer to your github development work

#Advance preparation
1. Refer to the page below to integrate github with JIRA
[How to integrate github with JIRA](https://qiita.com/Hakata2002/items/f5f95271fb8975019b87)

2. Set the workflow as below.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/caef3cc9-831b-cd4c-782a-53e496904704.png)|
|:-:|

3.Add triggers to each transmission

| From | To| Trigger |
|:-----------|:-----------|:-----------|
| Selected for Development       | Development In Progress        | Branch created |
| Development In Progress | Dev lead review| Pull request created|
| Development In Progress | Dev lead review| Pull request reopened|
| Dev lead review | Development In Progress| Pull request declined|
| Dev lead review | Done| Pull request merged|

To avoid forgetting to manually change the status that the transmission doesn't work, It is recommended to additionally add the transmission as follows. Any status -> Development In Progress, Any status -> Dev lead review, Any status -> Done

# Scenario one
**Developer created a new feature branch**
-1- Create a ticket in JIRA which issue key is "CICDTEST-2". CICDTEST-2 is an example.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/4b49a380-45a0-09f3-18a0-5f3f34f01b30.png)|
|:-:|
-2- Create a branch named with issue key locally.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/c96d91a8-67ee-3360-61ed-892b63b96e81.png)|
|:-:|
-3-  Push it to github

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/be97883d-5181-6f64-e8f8-10bf7ea099a6.png)|
|:-:|

-4- It will reflect automatically in JIRA related issue ticket

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/59877e28-a40c-9645-8ca7-3d2cbe444877.png)|
|:-:|

-5- The status in JIRA will be automatically changed from "Selected for Development" to "Development In Progress"

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/acf7a83b-1255-955b-4c07-52e7eed8577c.png)|
|:-:|

# Scenario two
**Developer send a pull request to ask dev lead have a review and merge**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/e2e56e74-404b-e90d-b797-9de33e53e70f.png)|
|:-:|
# Scenario three
**Dev lead declined the pull request with comment**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/4f75bd47-f8d6-7e86-0641-1ab453d1ec5a.png)|
|:-:|

Click the part below to sync quickly or confirm [How to change the interval or schedule of the DVCS repositories sync](https://confluence.atlassian.com/jirakb/how-to-change-the-interval-or-schedule-of-the-dvcs-repositories-sync-962980024.html) to shorten the sync interval.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/ca02c77c-6605-6d65-e961-8e93618275bb.png)|
|:-:|
Then the status changed.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/eef6d423-14bd-3b32-5050-e97fc830f080.png)|
|:-:|

# Scenario four
**Developer reopened the pull request and dev lead merged it to master branch**

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/399736/c0d1ea36-ed87-8e4b-f28a-ec3d833ee1aa.png)|
|:-:|


# Reference
[JIRA CloudとGitHubを連携する](https://839.hateblo.jp/entry/2019/12/12/210313
[JIRA WORKFLOW FOR SOFTWARE DEVELOPMENT AND QUALITY ANALYST (QA) TEAMS](https://abhilashshukla.com/best-practices/jira-workflow-for-software-development-and-quality-analyst-qa-teams/)
[How to Build a Jira Workflow for Scrum: The Complete 2020 Guide](https://www.idalko.com/jira-scrum-workflow/)