What does the integration offer?
Compass has a specific API integration with Circle CI. CircleCI sends build results to Compass's API, with detailed information. Compass is a dispatcher for CircleCI build failures; determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls and iPhone & Android push notifications, and escalates alerts until the alert is acknowledged or closed.
How does the integration work?
When the outcome does not equal success in CircleCI, an alert is created in Compass automatically through the integration.
When the outcome equals success in CircleCI, the corresponding alert in Compass, if one exists, is closed automatically through the integration.
Set up the integration
CircleCI is an API integration. Setting it up involves the following steps:
Add a CircleCI integration in Compass
Configure the integration in CircleCI
Add a CircleCI integration
Bidirectional integrations aren’t supported in the Standard plan. All the other integrations are supported at a team level in Standard.
If you're using the Standard plan in Compass, you can add this integration only from your team’s operations page. Adding an integration from your team’s operations page makes your team the owner of the integration. This means Compass only assigns the alerts received through this integration to your team.
To add a CircleCI integration in Compass, complete the following steps:
Go to your team’s operations page.
On the left navigation panel, select Integrations and then Add integration.
Run a search and select “CircleCI”.
On the next screen, enter a name for the integration.
Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.
Select Continue.
The integration is saved at this point.Expand the Steps to configure the integration section and copy the API key.
You will use this key while configuring the integration in CircleCI later.Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.
Configure the integration in CircleCI
To configure the integration of CircleCI with Compass, complete the following steps:
Add the following configuration to your circle.yml file.
Replace {API_KEY} with the API key you copied previously from .
Text
notify: webhooks: - url: https://api.atlassian.com/jsm/ops/integration/v1/json/integrations/webhooks/circleci?apiKey=${API_KEY}
Sample payload sent from CircleCI
Create Alert payload
JSON
{ "id": "8bd71c28-4969-3677-8940-3e3a61c46660", "type": "job-completed", "happened_at": "2021-09-01T22:49:34.279Z", "webhook": { "id": "cf8c4fdd-0587-4da1-b4ca-4846e9640af9", "name": "Sample Webhook" }, "project": { "id": "84996744-a854-4f5e-aea3-04e2851dc1d2", "name": "webhook-service", "slug": "github/circleci/webhook-service" }, "organization": { "id": "f22b6566-597d-46d5-ba74-99ef5bb3d85c", "name": "circleci" }, "pipeline": { "id": "1285fe1d-d3a6-44fc-8886-8979558254c4", "number": 130, "created_at": "2021-09-01T22:49:03.544Z", "trigger": { "type": "webhook" }, "vcs": { "provider_name": "github", "origin_repository_url": "https://github.com/circleci/webhook-service", "target_repository_url": "https://github.com/circleci/webhook-service", "revision": "1dc6aa69429bff4806ad6afe58d3d8f57e25973e", "commit": { "subject": "Description of change", "body": "More details about the change", "author": { "name": "Author Name", "email": "author.email@example.com" }, "authored_at": "2021-09-01T22:48:53Z", "committer": { "name": "Committer Name", "email": "committer.email@example.com" }, "committed_at": "2021-09-01T22:48:53Z" }, "branch": "main" } }, "workflow": { "id": "fda08377-fe7e-46b1-8992-3a7aaecac9c3", "name": "welcome", "created_at": "2021-09-01T22:49:03.616Z", "stopped_at": "2021-09-01T22:49:34.170Z", "url": "https://app.circleci.com/pipelines/github/circleci/webhook-service/130/workflows/fda08377-fe7e-46b1-8992-3a7aaecac9c3" }, "job": { "id": "8b91f9a8-7975-4e60-916c-f0152ccbc937", "name": "test", "started_at": "2021-09-01T22:4:28.841Z", "stopped_at": "2021-09-01T22:49:34.170Z", "status": "success", "number": 136 } }
Compass parses the payload as follows:
JSON
{ "id": "8bd71c28-4969-3677-8940-3e3a61c46660", "type": "job-completed", "happened_at": "2021-09-01T22:49:34.279Z", "webhook_id": "cf8c4fdd-0587-4da1-b4ca-4846e9640af9", "webhook_name": "Sample Webhook", "project_id": "84996744-a854-4f5e-aea3-04e2851dc1d2", "project_name": "webhook-service", "project_slug": "github/circleci/webhook-service" "pipeline_id": "1285fe1d-d3a6-44fc-8886-8979558254c4", "pipeline_number": 130, "pipeline_created_at": "2021-09-01T22:49:03.544Z", "pipeline_trigger_type": "webhook" "provider_name": "github", "repository_url": "https://github.com/circleci/webhook-service", "revision": "1dc6aa69429bff4806ad6afe58d3d8f57e25973e", "subject": "Description of change", "body": "More details about the change", "author_name": "Author Name", "author_email": "author.email@example.com", "authored_at": "2021-09-01T22:48:53Z", "committer_name": "Committer Name", "committer_email": "committer.email@example.com" "committed_at": "2021-09-01T22:48:53Z" "branch": "main", "workflow_id": "fda08377-fe7e-46b1-8992-3a7aaecac9c3", "workflow_name": "welcome", "workflow_created_at": "2021-09-01T22:49:03.616Z", "workflow_stopped_at": "2021-09-01T22:49:34.170Z", "workflow_url": "https://app.circleci.com/pipelines/github/circleci/webhook-service/130/workflows/fda08377-fe7e-46b1-8992-3a7aaecac9c3", "job_id": "8b91f9a8-7975-4e60-916c-f0152ccbc937", "job_name": "test", "job_started_at": "2021-09-01T22:49:28.841Z", "job_stopped_at": "2021-09-01T22:49:34.170Z", "job_status": "success", "job_number": 136 }