JIRA integration is an advanced feature, available with Enterprise Edition allowing you to synchronize the errors it tracks on your application with your JIRA tickets. You can create JIRA tickets using the error information, e.g. a stack trace, from Countly UI and work on the bug ticket with JIRA and its resolution status, e.g. In Progress, will be synchronized both ways.
Setting up JIRA integration for your instance
Generating the OAuth Key Pair
First, we need to generate a private key.
openssl genrsa -out jira_privatekey.pem 1024
Then we need to generate a certificate from the private key.
openssl req -newkey rsa:1024 -x509 -key jira_privatekey.pem -out jira_publickey.cer -days 365
Then we need to extract the public key from the certificate.
openssl x509 -pubkey -noout -in jira_publickey.cer > jira_publickey.pem
Setting up the JIRA application link
As an admin of your JIRA site administrator, navigate to the site sidebar > cog icon > Products. In the next screen, navigate to "Application links" in the left sidebar.
Start creating a new application link by entering your Countly instance's URL in the text box and clicking "Create new link". There will be an alert notifying you that no response was received from the URL you entered and that it may not be valid, disregard it and click Continue.
In the next modal, fill in the "Application Name" field with anything you like, but we recommend "Countly". Leave "Application Type" as "Generic Application". Click Continue and the application link should be created succesfully.
Now configure OAuth by editing your newly created application link, clicking the pencil icon on its far right side.
- Navigate to Incoming Authentication. Fill the following fields and click save:
- Consumer Key: Any string will do, we recommend something like a password, e.g
- Consumer Name: A short name to identify your Countly instance.
- Description (optional): A short description to identify your Countly instance.
- Public Key: The contents of the file
jira_publickey.pembetween but not including the lines starting with hyphens.
Setting up the Countly JIRA Plugin
Now, as a global admin of your Countly instance, navigate to Management > Configurations and then JIRA Crashes under Plugins. Fill all the fields: - Consumer Key: The arbitrary string you chose while setting up the application link on JIRA. - JIRA API URL: URL of the JIRA server, e.g. "https://foobar.atlassian.net". - Private Key: The contents of the file
jira_privatekey.pem between but not including the lines starting with hyphens. - Callback URL: Fully qualified URL of the API server of your Countly instance, e.g. "https://foobar.count.ly".
Authorize Countly to use your account to synchronize crashes by clicking "Login" on the JIRA Crashes configuration page which should take you to your JIRA instance, asking if you want to authorize your Countly application with the current logged-in JIRA account.
Create corresponding JIRA projects for your Countly applications if you haven't. For each application-project pair: 1. Navigate to Management > Applications > your-application > App Configurations > JIRA Crashes. 2. Fill all the fields, keeping in mind that they are case-sensitive with JIRA so "To do" won't work if the JIRA workflow state is "To Do". - Project: JIRA project key/slug to create issue in, e.g. If your project is "Test Project" then your key/slug will probably be "TP". - Issue Type: JIRA issue name to create issues with, e.g. Bug. - To Do States: JIRA issue status names corresponding to unresolved crashes, e.g. To Do. - Done States: JIRA issue status names corresponding to resolved crashes, e.g. Done.
How does Countly choose a JIRA status to synchronize if there are multiple?
When a crash resolution change is made on the Countly side and needs to be synchronized to JIRA, the first state on the corresponding configuriation will be chosen. For example, "Done" will be chosen if the crash is marked as resolved and Done states are "Done" and "Cancelled", in that order.
Creating a JIRA task for a Countly crash
Having set JIRA integration up, you can create a JIRA task for any crash/error on Countly by clicking "Create JIRA Task" in a crash manipulation menu.
This will open a modal in which you can edit the JIRA task's title and body.
Once you're satisfied with the task's title and body, click "Create JIRA Issue" and you should see a notification informing you that the task has been succesfully created.
From now on, the issue will be synchronized both ways. It will be set to resolved/resolving/unresolved when it's marked accordingly on JIRA, and vice versa.