diff --git a/opt/00-infrastructure/atlassian/PHASE-2-COMPLETE.md b/opt/00-infrastructure/atlassian/PHASE-2-COMPLETE.md index ba0e12e..d182997 100644 --- a/opt/00-infrastructure/atlassian/PHASE-2-COMPLETE.md +++ b/opt/00-infrastructure/atlassian/PHASE-2-COMPLETE.md @@ -71,15 +71,17 @@ Using REST API v2 endpoint: `POST /rest/api/2/filter` --- -## API Endpoints Summary +## API Endpoints Summary - CORRECTED -| Task | v2 Endpoint | v3 Endpoint | Status | -|------|-------------|-------------|--------| -| Create Field | N/A | `/rest/api/3/field` | ✅ Works | -| Create Component | `/rest/api/2/component` | ❌ Not in Cloud | ✅ Works (v2) | -| Create Filter | `/rest/api/2/filter` | `/rest/api/3/filter` | ✅ Works (v2) | -| Projects | `/rest/api/2/project` | `/rest/api/3/projects/search` | v2 more reliable | -| Myself | Both work | Both work | ✅ | +| Task | Endpoint | Method | Status | +|------|----------|--------|--------| +| Create Field | `/rest/api/3/field` | POST | ✅ Works | +| Create Component | `/rest/api/3/component` | POST | ✅ Works | +| Create Filter | `/rest/api/3/filter` | POST | ✅ Works | +| Get Projects | `/rest/api/3/project/search` | GET | ✅ Works | +| Get Myself | `/rest/api/3/myself` | GET | ✅ Works | + +**Key Discovery:** ALL endpoints use REST API v3! v2 still works but v3 is the official Cloud API. --- diff --git a/opt/00-infrastructure/atlassian/scripts/05-create-components.sh b/opt/00-infrastructure/atlassian/scripts/05-create-components.sh index 5075b39..876ad5d 100755 --- a/opt/00-infrastructure/atlassian/scripts/05-create-components.sh +++ b/opt/00-infrastructure/atlassian/scripts/05-create-components.sh @@ -23,9 +23,9 @@ create_component() { echo "Creating component: $name..." - # Use REST API v2 for components (v3 doesn't have this endpoint in Cloud) + # Create component using REST API v3 - correct endpoint is /rest/api/3/component curl -s -X POST \ - "${ATLASSIAN_SITE_URL}/rest/api/2/component" \ + "${ATLASSIAN_SITE_URL}/rest/api/3/component" \ -H "Authorization: Basic ${JIRA_AUTH}" \ -H "Content-Type: application/json" \ -d "{\"name\": \"$name\", \"description\": \"$description\", \"project\": \"PROD\"}" > /tmp/component_response.json diff --git a/opt/00-infrastructure/atlassian/scripts/06-create-filters.sh b/opt/00-infrastructure/atlassian/scripts/06-create-filters.sh index 43e84f2..f46b924 100755 --- a/opt/00-infrastructure/atlassian/scripts/06-create-filters.sh +++ b/opt/00-infrastructure/atlassian/scripts/06-create-filters.sh @@ -19,11 +19,11 @@ create_filter() { echo "Creating filter: $name..." - # Use REST API v2 for filters + # Use REST API v3 for filters - correct endpoint local json_data="{\"name\": \"$name\", \"description\": \"$description\", \"jql\": \"$jql\", \"favourite\": $favourite}" curl -s -X POST \ - "${ATLASSIAN_SITE_URL}/rest/api/2/filter" \ + "${ATLASSIAN_SITE_URL}/rest/api/3/filter" \ -H "Authorization: Basic ${JIRA_AUTH}" \ -H "Content-Type: application/json" \ -d "$json_data" > /tmp/filter_response.json