OVHserver/opt/00-infrastructure/atlassian/scripts/03-create-projects.sh
SamoilenkoVadym 032d1fe23c feat: add Atlassian Cloud Jira configuration infrastructure
- Complete Atlassian Cloud setup with 4 projects (PROD, MARK, SUPP, OPS)
- 8 automation scripts for infrastructure provisioning
- Secure credential management via .env.atlassian
- API authentication verified and working
- Identified Jira Cloud API limitations for Phase 2
- Added comprehensive documentation and status reports
- PHASE-2 BLOCKER: Custom fields cannot be created via Cloud API (manual UI required)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 09:44:31 +00:00

50 lines
1.6 KiB
Bash
Executable file

#!/bin/bash
source /tmp/atlassian-setup/credentials.env
echo "=== Week 1 Day 2: Creating 4 Jira Projects ==="
echo ""
# Save all responses to file for documentation
RESPONSES="/tmp/atlassian-setup/project-creation-responses.log"
> "$RESPONSES"
# Function to create project
create_project() {
local key=$1
local name=$2
local template=$3
local description=$4
echo "Creating $key - $name ($template)..."
local response=$(curl -s -X POST \
"${ATLASSIAN_SITE_URL}/rest/api/3/projects" \
-H "Authorization: Basic ${JIRA_AUTH}" \
-H "Content-Type: application/json" \
-d "{
\"key\": \"$key\",
\"name\": \"$name\",
\"description\": \"$description\",
\"projectTypeKey\": \"software\",
\"projectTemplateKey\": \"com.atlassian.jira-core-project-templates:jira-${template}-project\"
}")
echo "$response" >> "$RESPONSES"
# Check if successful (look for key in response)
if echo "$response" | grep -q "\"key\":\"$key\""; then
echo "$key created successfully"
else
echo "$key response: $(echo $response | cut -c1-100)..."
fi
echo ""
}
# Create all 4 projects
create_project "PROD" "Product & Engineering" "scrum" "Website development and client project delivery"
create_project "MARK" "Marketing & Sales" "kanban" "Sales pipeline, leads, clients, and marketing campaigns"
create_project "SUPP" "Customer Support" "service-desk" "Client tickets, technical support, and escalations"
create_project "OPS" "Operations" "business" "Finance, contracts, HR, and compliance"
echo "See $RESPONSES for full API responses"