Connects the CI/CD pipeline to Jira and Confluence via the Atlassian REST API.
| Script | Purpose |
|---|---|
jira-update.sh |
Post a build status comment to a Jira issue and optionally transition it |
confluence-update.sh |
Overwrite a Confluence page with a build status + tool inventory table |
Both scripts are called automatically by the Atlassian stage in Jenkinsfile and atlassian:update job in .gitlab-ci.yml when ATLASSIAN_UPDATE=true.
- Log in to id.atlassian.com
- Create API token → give it a name (e.g.
devkit-ci) - Copy the token — you will not see it again
Jenkins (Manage Jenkins → Credentials → System → Global → Add Credential → Secret text):
| ID | Value |
|---|---|
ATLASSIAN_BASE_URL |
https://your-org.atlassian.net |
ATLASSIAN_USER_EMAIL |
email of the account that owns the API token |
ATLASSIAN_API_TOKEN |
the token from step 1 |
GitLab (Settings → CI/CD → Variables, mark ATLASSIAN_API_TOKEN as Masked):
| Key | Value |
|---|---|
ATLASSIAN_BASE_URL |
https://your-org.atlassian.net |
ATLASSIAN_USER_EMAIL |
email of the account that owns the API token |
ATLASSIAN_API_TOKEN |
the token from step 1 |
Copy the template and record your project key and page IDs:
cp .ci/atlassian/atlassian.config.json .ci/atlassian/atlassian.local.json
# edit atlassian.local.json — this file is gitignoredNever commit your API token.
atlassian.config.jsonis a template with placeholder values only.
Open the page in your browser. The URL contains the page ID:
https://your-org.atlassian.net/wiki/spaces/DEVKIT/pages/123456789/DevKit+Status
^^^^^^^^^^^
On the page: ⋯ (More actions) → Page information — the ID appears in the URL.
curl -u email:token \
"https://your-org.atlassian.net/wiki/rest/api/content?title=DevKit+Status&spaceKey=DEVKIT"The pipeline transitions the Jira issue based on build result. Default mappings:
| Build result | Default transition |
|---|---|
SUCCESS |
Done |
FAILURE |
In Progress |
UNSTABLE |
In Review |
Override these with environment variables in Jenkins/GitLab:
JIRA_TRANSITION_SUCCESS=Done
JIRA_TRANSITION_FAILURE="In Progress"
JIRA_TRANSITION_UNSTABLE="In Review"To see the available transitions for your workflow:
curl -u email:token \
"https://your-org.atlassian.net/rest/api/3/issue/DEVKIT-42/transitions"export ATLASSIAN_BASE_URL="https://your-org.atlassian.net"
export ATLASSIAN_USER_EMAIL="you@org.com"
export ATLASSIAN_API_TOKEN="your-token"
# Post to Jira
bash .ci/atlassian/jira-update.sh \
--issue DEVKIT-42 \
--status SUCCESS \
--url "https://jenkins.example.com/job/devkit/42/" \
--profile cpp-dev \
--team "Platform Team"
# Update Confluence page
bash .ci/atlassian/confluence-update.sh \
--page-id 123456789 \
--status SUCCESS \
--url "https://jenkins.example.com/job/devkit/42/" \
--profile cpp-dev \
--team "Platform Team" \
--build 42If you set DEVKIT_SERVER_HOST when calling confluence-update.sh, it fetches the live tool inventory from GET /api/tools and renders it as a table on the page:
export DEVKIT_SERVER_HOST=127.0.0.1
export DEVKIT_SERVER_PORT=9090
bash .ci/atlassian/confluence-update.sh --page-id 123456789 ...Without this, the tool table shows a placeholder message.
| Endpoint | Used by |
|---|---|
POST /rest/api/3/issue/{key}/comment |
jira-update.sh — adds build status comment |
GET /rest/api/3/issue/{key}/transitions |
jira-update.sh — discovers available workflow transitions |
POST /rest/api/3/issue/{key}/transitions |
jira-update.sh — moves issue through workflow |
PUT /rest/api/3/issue/{key} |
jira-update.sh — adds devkit-deployed label |
GET /wiki/rest/api/content/{id} |
confluence-update.sh — fetches current page version |
PUT /wiki/rest/api/content/{id} |
confluence-update.sh — overwrites page body |
GET /api/tools |
confluence-update.sh — live tool list from devkit server |