-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Send in-app feedback to Jira | ||
|
||
This [code](functions/index.js) demonstrates how to use a Firebase Cloud Function triggered by an | ||
[in-app feedback Firebase Alert from App Distribution](https://firebase.google.com/docs/functions/beta/reference/firebase-functions.alerts.appdistribution.inappfeedbackpayload), | ||
and stores the feedback details (including screenshot) in Jira. | ||
|
||
You can customize this code to work with your own Jira configuration (eg on-premise support, custom issue types, etc). | ||
|
||
## Quickstart | ||
|
||
This sample code uses Jira's built-in APIs to create issues for in-app tester feedback. For simplicity it uses [basic authorization](https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/). | ||
|
||
1. [Generate an API token](https://id.atlassian.com/manage-profile/security/api-tokens) via your Jira profile. | ||
|
||
|
||
Note: If the tester who files feedback does not have a Jira account, the user who generates this token will be marked as the issue's reporter. | ||
2. This [code](functions/index.js) uses [parameterized configuration](https://firebase.google.com/docs/functions/config-env#params) to prompt for the required configuratio. To start the process, run: | ||
```bash | ||
$ firebase deploy | ||
``` | ||
This will store the `API_TOKEN` using [Google Cloud Secret Manager](https://cloud.google.com/secret-manager) and the remaining settings in an `.env` file which will contain the following variables, customized to your Jira project: | ||
```bash | ||
JIRA_URI="<your JIRA instance's URI, e.g. 'https://mysite.atlassian.net'>" | ||
PROJECT_KEY="<your project's key, e.g. 'DEV'>" | ||
ISSUE_TYPE_ID="<issue type ID; defaults to '10001' (Improvement)>" | ||
ISSUE_LABEL="<label applied to the Jira issues created; defaults to 'in-app'>" | ||
API_TOKEN_OWNER="<creator of the token; default reporter of issues>" | ||
``` | ||
|
||
## License | ||
© Google, 2022. Licensed under an [Apache-2 license](../../LICENSE). |