|
1 | 1 | # Sync issues from GitHub to Jira
|
2 | 2 |
|
3 |
| -Automation to sync issues from GitHub (using GitHub actions) to Jira (via Jira webhooks) |
4 |
| - |
5 |
| -## Principle |
6 |
| - |
7 |
| -Labelling any GitHub issue with `jira` (can be parameterized) will trigger a Jira issue to be created with the same |
8 |
| -title and description. Starting from that moment in time, any supported actions on the GitHub issue will be mirrored |
9 |
| -on your Jira board with the corresponding ticket. |
10 |
| - |
11 |
| -### Supported actions |
12 |
| - |
13 |
| -* Labelling a GitHub issue will create a corresponding Jira issue linking back to the GitHub issue. Title and description |
14 |
| - are imported and the issue will be tagged with the selected component. |
15 |
| -* Removing the label on a GitHub issue will delete the corresponding Jira issue. |
16 |
| - |
17 |
| -Once labelled: |
18 |
| - |
19 |
| -* Any changes in title and description will update the corresponding Jira issue. |
20 |
| -* Any new comments will be mirrored on Jira. If you want to mirror a comment that was posted before the issue was |
21 |
| - labelled, you can edit the comment. |
22 |
| -* Editing a comment will post as a new comment on Jira (you can still see the previous comment content as a separate one). |
23 |
| -* Closing an issue will set the Jira issue to `Done`. |
24 |
| -* Reopening an issue will set the Jira issue to `Selected for development`. |
25 |
| - |
26 |
| -### Known limitations |
27 |
| - |
28 |
| -* Deleting an issue on GitHub (admin only action) will not delete it on Jira (we can not retrieve the label). |
29 |
| -* The syncing is only one way: GitHub to Jira. Action on Jira issues will not be mirrored back on GitHub issue. |
30 |
| - |
31 |
| -## Usage |
32 |
| - |
33 |
| -```yaml |
34 |
| -- uses: canonical/sync-issues-github-jira@v1 |
35 |
| - with: |
36 |
| - # Jira integration webhook URL. |
37 |
| - # Store it as a secret as anyone who has access to it will be able to post to your Jira board. |
38 |
| - # This field is required. |
39 |
| - webhook-url: '' |
40 |
| - |
41 |
| - # Jira component to attach your issue to. This component should exists in your project. |
42 |
| - component: '' |
43 |
| - |
44 |
| - # Label which will trigger a Jira import. |
45 |
| - # This default to jira. |
46 |
| - label: 'jira' |
47 |
| -``` |
48 |
| -
|
49 |
| -To trigger your action, you need to listen on both `issues` and `issue_comment` events. |
50 |
| - |
51 |
| -## Examples |
52 |
| - |
53 |
| -### Use jira as importing label with no components |
| 3 | +Example github workflow |
54 | 4 |
|
55 | 5 | ```yaml
|
56 | 6 | name: Sync GitHub issues to Jira example
|
|
72 | 22 | JIRA_EPIC_KEY: ${{ secrets.JIRA_EPIC_KEY }}
|
73 | 23 | ```
|
74 | 24 |
|
75 |
| -As stated in the description, use a secret to store your Jira webhook URL. Otherwise, anyone who has access to it |
76 |
| -will be able to post to your Jira board. |
77 |
| - |
78 |
| -This default configuration will not attach any Jira component to your issue and will trigger on any GitHub issue action |
79 |
| -with the label `jira`. |
80 |
| - |
81 | 25 | ## Debug
|
82 | 26 |
|
83 | 27 | Debug using [act](https://github.com/nektos/act) with the following command:
|
|
0 commit comments