A broken build in your CI/CD pipeline is a critical event. It stops features from shipping, blocks other developers, and requires immediate attention. But how is that failure communicated? Too often, it’s a transient notification lost in a noisy Slack channel or a generic email that's easily ignored. The developer who broke the build might not even see it for hours. Meanwhile, the pipeline stays red.
What if you could treat that build failure like any other critical bug? What if you could automatically create a high-priority, fully-contextualized task and assign it to the right person, all within seconds of the failure?
This is the power of programmable issue management. By embedding issue tracking directly into your build and deploy process, you can move from noisy notifications to actionable, trackable work. This tutorial will show you how to use issues.do, an API for modern issue tracking, to automatically fail a build, create a high-priority issue, and assign it to the right team.
Traditional issue trackers are GUIs. They are disconnected from the automated systems where work actually happens and breaks. An API-first approach, like the one provided by issues.do, fundamentally changes this relationship.
By managing bugs, tasks, and incidents as code, you gain several key advantages:
Let's contrast the manual process with an automated one.
The Old Way:
The New Way with issues.do:
The automated workflow takes seconds and requires zero human intervention to get the ball rolling.
Let's build a practical example using GitHub Actions. The same principles apply to GitLab CI, Jenkins, CircleCI, or any other modern CI/CD system.
In your GitHub repository, navigate to Settings > Secrets and variables > Actions. Click New repository secret and create a secret named ISSUES_DO_API_KEY with the value of your API key.
Here is a simple workflow that runs tests. We'll add a step that intentionally fails for this demonstration.
# .github/workflows/ci.yml
name: CI Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run unit tests
run: |
echo "Running application tests..."
# This command will fail, triggering our issue creation step
exit 1
Now for the magic. We'll add a new step to this job that only runs if a preceding step has failed. This step will use curl to make a POST request to the issues.do API.
# .github/workflows/ci.yml
name: CI Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run unit tests
id: tests
run: |
echo "Running application tests..."
exit 1
- name: Create Issue on Failure
# This step only runs if the 'tests' step failed
if: failure() && steps.tests.outcome == 'failure'
run: |
curl -X POST https://api.issues.do/v1/issues \
-H "Authorization: Bearer ${{ secrets.ISSUES_DO_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"title": "CI Build Failed on branch ${{ github.ref_name }}",
"description": "The `Run unit tests` step failed for commit `${{ github.sha }}`. \n\n[View Build Logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})",
"priority": "High",
"assignee": "dev-team@example.com",
"labels": ["bug", "ci-failure", "automated"]
}'
Let's break down the Create Issue on Failure step:
Now, when this workflow runs and the test step fails, a perfectly formatted, high-priority issue will be waiting in your issues.do project dashboard.
Automating incident response for build failures is just the beginning. With a powerful task management API like issues.do, you can orchestrate your entire development lifecycle:
By treating your operational tasks as code, you create a development process that is more resilient, transparent, and efficient.
Ready to streamline your development lifecycle? Get started with issues.do today and integrate powerful, programmable issue tracking directly into your workflows.