Jira allows you to create complex hierarchy between issues to better organize your project. However, if you are syncing such a Jira project to GitHub, chances are you would want to maintain some semblance of this hierarchy on the GitHub side as well. The only effective way we found to do this was by using Task Lists in GitHub. Once you get a hang of how these TaskLists work, you can build complex hierarchical structures even in GitHub!

Use Case

The use case being discussed here would be syncing Jira issues to GitHub issues with the following requirements:


Solution


Step 1: Set up Trigger on Jira side.


Step 2: Determine the target repository in GitHub based on user selection from Jira side.

Step 3: If Jira is sending an Epic, add the child issues to the replica.

Step 4: Add TaskLists to the GitHub issues based on whether an Epic has arrived or a child issue.

Step 5: Icing on the cake!

Step 6: Status sync from GitHub to Jira

Demo and code

Here are the full code snippets used in this use case:

GitHub Incoming.groovy

GitHub Outgoing.groovy

Jira Incoming.groovy

Jira Outgoing.groovy


Watch the use case in action:



Happy Exalating!