When there are multiple repositories under a single organization and the total number of repositories is high, it might be difficult to find all the issues that are reported. You will want to record all the issues in a single place.
In this guide, we explain how to use the Github connector to get details of the newly created Github issues (e.g., Repository Name, Issue Title, Issue Description, Issue status) for all the repositories under your account. We then add those details to a Google spreadsheet using the Google Spreadsheet connector.
How the solution works
The following diagram illustrates how the solution works:
Get Github issue details using the listRepositoryIssues operation (poll using scheduled tasks).
Add the issue details to a Google Spreadsheet using the addRowsColumnsData operation.
Before you begin, follow the guides below to set up Github and Google Spreadsheets:
Let's get started.
- Go to WSO2 Cloud and sign up if you haven't done so already. The UI guides you through the signup process.
- Sign in to WSO2 Cloud and go to the Integration Cloud tab. Then, click ESB Compsite Application.
- Select the Local File System option and click Continue.
What is a CAR file? A Composite Application (CAR) is an archive file that has the collection of artifacts that you want to deploy in a WSO2 product instance. These artifacts are usually JAVA-based or XML configurations, designed differently for each product in the WSO2 Carbon platform. You can deploy these artifacts to generate services.
You link to the Google spreadsheet and the Github account that you use in this scenario using environment variables. Download this file and change the values of the variables according to your requirements.
Click here to read more information about the environment variables used in this file...
Here's a description of the properties:
googlespreadsheet_accessToken: Access token through the OAuth2 playground.
googlespreadsheet_refreshToken: Refresh token to exchange with an access token.
googlespreadsheet_clientId: Value of the client id that you obtain via the Google developer console.
googlespreadsheet_clientSecret: Value of the client secret that you obtain via the Google developer console.
googlespreadsheet_apiUrl: The application URL of Google Sheet version v4.
googlespreadsheet_spreadsheetId: Unique value of the spreadsheet.
googlespreadsheet_range: The A1 notation of the values to retrieve.
googlespreadsheet_valueInputOption: How the input data should be interpreted. For more information, click here.
github_apiUrl: URL of the Github API. If not provided, it is set to
github_accessToken: Mandatory. The access token used to call the Github API methods.
github_mediaType: Custom media type used by the API to let consumers choose the format of the data they wish to receive.
github_owner: Mandatory. The name of the owner of the repository.
github_repos: Mandatory. The name of the repositories. If you have multiple repos, pass them as a comma-separated list.
github_milestone: The milestone number. If an
integeris passed, it should refer to a milestone number. If the string
*is passed, issues with any milestone are accepted. If the string
noneis passed, issues without milestones are returned. The default is
github_state: The state of the issues to return. Can be
all. The default is
github_assignee: The user whose issues you want to list. Set to
noneto list issues with no assigned user and
*for issues assigned to any user. The default is
github_creator: The user that created the issue.
github_mentioned: A user mentioned in the issue.
github_labels: A comma-separated list of label names. For example,
github_sort: The field to use for sorting the results. Can be
comments. The default is
github_direction: The order in which items are sorted. Can be either
desc. The default is
- github_perPage: Items per page that you want to retrieve. the default is 30.
- task_interval_time: The interval time of the scheduled task in seconds. The default is 120 seconds.
- Click the Advanced Setting... link, expand the Environment Variables section, and upload the JSON file that you created in the previous step.
- Click the Create button at the end of the form to complete creating the application.
- Note that you see the application's Overview page once the application is deployed in the Cloud.
You have now created an application in WSO2 Integration Cloud. Let's see how to test the scenario.
- Go to your Github repository and create new issue with a description and some issue comments. Here's an example:
Note the newly added issue details in the Google Spreadsheet that you linked to in step 7 above:
You have now used the WSO2 connectors in the Connector store to Export github issues to spreadsheet.
Want to customize the default use case?
In this guide, you tried the solution on WSO2 Integration Cloud. You can do the same on-premise with your own WSO2 Enterprise Integrator instance. To modify the default scenario, see Modify the Default Github to Spreadsheet Scenario2.