atlassian-attachments
Attach documents, screenshots, PDFs, and files to Jira issues and Confluence pages via REST API. Use when uploading evidence, documentation, or media to Atlassian products.
What this skill does
# Atlassian Attachments Skill Attach files, screenshots, and documents to Jira issues and Confluence pages using the Atlassian REST API. ## Authentication Setup ### API Token (Required) Generate an API token at: https://id.atlassian.com/manage-profile/security/api-tokens ### Environment Variables ```bash export ATLASSIAN_DOMAIN="your-domain" export ATLASSIAN_EMAIL="[email protected]" export ATLASSIAN_API_TOKEN="your-api-token" ``` ### Setup via .envrc (Recommended) If environment variables are not set, add them to `.envrc` in your project root for automatic loading with [direnv](https://direnv.net/): ```bash # .envrc export ATLASSIAN_DOMAIN="your-domain" export ATLASSIAN_EMAIL="[email protected]" export ATLASSIAN_API_TOKEN="your-api-token" ``` Then allow the file: ```bash direnv allow ``` **Security Note:** Add `.envrc` to `.gitignore` to prevent committing credentials: ```bash echo ".envrc" >> .gitignore ``` ### Check Environment Setup ```bash # Verify variables are set echo "Domain: ${ATLASSIAN_DOMAIN:-NOT SET}" echo "Email: ${ATLASSIAN_EMAIL:-NOT SET}" echo "Token: ${ATLASSIAN_API_TOKEN:+SET}" ``` If any show "NOT SET", prompt the user to configure `.envrc`. ### Base URLs ``` Jira: https://{domain}.atlassian.net/rest/api/3 Confluence: https://{domain}.atlassian.net/wiki/rest/api ``` ## Jira REST API - Upload Attachments ### Endpoint ``` POST https://{domain}.atlassian.net/rest/api/3/issue/{issueIdOrKey}/attachments ``` ### Required Headers | Header | Value | Purpose | |--------|-------|---------| | `X-Atlassian-Token` | `no-check` | CSRF protection bypass (required) | | `Content-Type` | `multipart/form-data` | File upload format | ### cURL Command ```bash curl --location --request POST \ 'https://your-domain.atlassian.net/rest/api/3/issue/PROJ-123/attachments' \ -u '[email protected]:<api_token>' \ -H 'X-Atlassian-Token: no-check' \ --form 'file=@"./screenshots/bug-evidence.png"' ``` ### Python Example ```python import requests from requests.auth import HTTPBasicAuth def upload_jira_attachment(domain, email, api_token, issue_key, file_path): url = f"https://{domain}.atlassian.net/rest/api/3/issue/{issue_key}/attachments" auth = HTTPBasicAuth(email, api_token) headers = { "X-Atlassian-Token": "no-check" } with open(file_path, 'rb') as file: files = {'file': file} response = requests.post(url, auth=auth, headers=headers, files=files) if response.status_code == 200: return response.json() else: raise Exception(f"Upload failed: {response.status_code} - {response.text}") # Usage result = upload_jira_attachment( domain="your-domain", email="[email protected]", api_token="your-api-token", issue_key="PROJ-123", file_path="./screenshots/bug-evidence.png" ) ``` ### Bash Script - Multiple Files ```bash #!/bin/bash DOMAIN="your-domain" EMAIL="[email protected]" API_TOKEN="your-api-token" ISSUE_KEY="PROJ-123" FILES_DIR="./qa-tests/screenshots/" for file in "$FILES_DIR"*.png; do echo "Uploading: $file" curl --silent --location --request POST \ "https://${DOMAIN}.atlassian.net/rest/api/3/issue/${ISSUE_KEY}/attachments" \ -u "${EMAIL}:${API_TOKEN}" \ -H "X-Atlassian-Token: no-check" \ --form "file=@\"$file\"" echo " Done" done ``` ## Confluence REST API - Upload Attachments ### Endpoint ``` POST https://{domain}.atlassian.net/wiki/rest/api/content/{pageId}/child/attachment ``` ### Required Headers | Header | Value | Purpose | |--------|-------|---------| | `X-Atlassian-Token` | `nocheck` | CSRF protection bypass (required) | | `Content-Type` | `multipart/form-data` | File upload format | ### cURL Command - Basic Auth ```bash curl -u "${USER_EMAIL}:${API_TOKEN}" \ -X POST \ -H "X-Atlassian-Token: nocheck" \ -F "file=@./diagram.png" \ -F "comment=Uploaded via REST API" \ "https://${DOMAIN}.atlassian.net/wiki/rest/api/content/${PAGE_ID}/child/attachment" ``` ### cURL Command - Personal Access Token ```bash curl -X POST \ -H "Authorization: Bearer ${PAT_TOKEN}" \ -H "X-Atlassian-Token: no-check" \ -H "Content-Type: multipart/form-data" \ -F "file=@./document.pdf" \ "https://${DOMAIN}.atlassian.net/wiki/rest/api/content/${PAGE_ID}/child/attachment" ``` ### Python Example ```python import requests from requests.auth import HTTPBasicAuth def upload_confluence_attachment(domain, email, api_token, page_id, file_path, comment=""): url = f"https://{domain}.atlassian.net/wiki/rest/api/content/{page_id}/child/attachment" auth = HTTPBasicAuth(email, api_token) headers = { "X-Atlassian-Token": "nocheck" } with open(file_path, 'rb') as file: files = {'file': file} data = {'comment': comment} if comment else {} response = requests.post(url, auth=auth, headers=headers, files=files, data=data) if response.status_code in [200, 201]: return response.json() else: raise Exception(f"Upload failed: {response.status_code} - {response.text}") # Usage result = upload_confluence_attachment( domain="your-domain", email="[email protected]", api_token="your-api-token", page_id="123456789", file_path="./docs/architecture.png", comment="Architecture diagram v2" ) ``` ### Get Page ID by Title ```bash # Find page ID from title curl -u "${EMAIL}:${API_TOKEN}" \ "https://${DOMAIN}.atlassian.net/wiki/rest/api/content?title=Page%20Title&spaceKey=SPACE" \ | jq '.results[0].id' ``` ### Embed Attachment in Page Content After uploading, the attachment is in the page's attachment list but **NOT embedded** in content. You must update the page body to display it. #### Important: Use Markdown, Not Wiki Markup | Format | Syntax | Works with API? | |--------|--------|-----------------| | Wiki markup | `!image.png!` | **NO** - Not converted | | Markdown | `` | **YES** - Converted to storage format | | Storage format | `<ac:image>...</ac:image>` | **YES** - Native format | **Key insight:** Markdown image syntax gets automatically converted to Confluence storage format when using the API. #### CRITICAL: Storage Format for Attachments vs External URLs When using storage format directly, you MUST use the correct element for referencing attachments: | Reference Type | Element | Use Case | |----------------|---------|----------| | Page attachment | `<ri:attachment ri:filename="..."/>` | Files uploaded to the page | | External URL | `<ri:url ri:value="..."/>` | External image URLs | **WRONG - Using ri:url for attachments (images won't display):** ```xml <ac:image ac:src="screenshot.png"> <ri:url ri:value="screenshot.png" /> </ac:image> ``` **CORRECT - Using ri:attachment for uploaded files:** ```xml <ac:image> <ri:attachment ri:filename="screenshot.png" /> </ac:image> ``` The `ri:url` element is for external URLs only. For files uploaded as attachments to the page, you MUST use `ri:attachment` with `ri:filename`. #### Method 1: Markdown (Recommended) Use `representation: "wiki"` with Markdown syntax: ```bash curl -u "${EMAIL}:${API_TOKEN}" \ -X PUT \ -H "Content-Type: application/json" \ "https://${DOMAIN}.atlassian.net/wiki/rest/api/content/${PAGE_ID}" \ -d '{ "version": {"number": NEW_VERSION}, "title": "Page Title", "type": "page", "body": { "wiki": { "value": "# My Page\n\nHere is the diagram:\n\n\n\nMore content here.", "representation": "wiki" } } }' ``` #### Method 2: Storage Format (Direct) Use native Confluence storage format with `representation: "storage"`: ```bash curl -u "${EMAIL}:${API_TOKEN}" \ -X PUT \ -H "Content-Type: application/json" \ "https://${DOMAIN}.atlassian.net/wiki/rest/api/content/${PAGE_ID}" \ -d '{ "version": {"number": NEW_VERSION}, "title": "Page Title", "type": "page", "body": { "sto
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.