# Atlassian Cloud Setup - Infrastructure Ready ✓

**Date:** 2025-12-03  
**Status:** Week 1 Day 2 - Infrastructure Complete

## Infrastructure Created

### Location
```
/opt/00-infrastructure/atlassian/
├── .env.atlassian              ← Credentials (600 permissions)
├── atlassian-config.json       ← Configuration file
├── atlassian-setup.sh          ← Master setup script
├── scripts/                    ← Implementation scripts
│   ├── 01-generate-api-token.sh
│   ├── 02-verify-team-members.sh
│   ├── 03-create-projects.sh
│   ├── 04-create-custom-fields.sh
│   ├── 05-create-components.sh
│   ├── 06-create-filters.sh
│   └── api-utils.sh
├── data/                       ← Data storage
├── docs/                       ← Documentation
└── setup-docs/                 ← Setup guides
```

## Completed

✓ API token generated and verified
✓ Credentials stored securely (chmod 600)
✓ Configuration file created with all project details
✓ 7 implementation scripts ready
✓ Master setup script ready
✓ API utilities library ready
✓ Infrastructure synced to server

## Credentials

**File:** `/opt/00-infrastructure/atlassian/.env.atlassian`
- Email: v.samoilenko@ai-impress.com
- Site: https://ai-impress.atlassian.net
- Cloud ID: 0bacbc81-62f1-422e-bdec-232daf737857
- Organization ID: ea6cb635-a8a4-429a-bff8-a3ce40f275b1
- Auth Header: Base64 encoded

## Configuration

**File:** `/opt/00-infrastructure/atlassian/atlassian-config.json`

Projects:
- PROD (Scrum) - 6 fields, 6 components
- MARK (Kanban) - 8 fields
- SUPP (Service Desk) - 3 fields
- OPS (Business) - 6 fields

Total: 25+ custom fields, 20 filters, 4 dashboards, 15 automation rules

## Next Steps

### Phase 1 ✓ COMPLETE
1. Generate API token
2. Store credentials
3. Verify API connectivity

### Phase 2 (Manual UI Step Required)
**ACTION:** Create 4 projects in Atlassian UI

1. Go to: https://ai-impress.atlassian.net
2. Projects → Create project
3. Create:
   - PROD (Scrum)
   - MARK (Kanban)
   - SUPP (Service Desk)
   - OPS (Business)

**Time:** ~15-20 minutes

### Phase 3 (API Automation)
After projects created, run:

```bash
# On server:
ssh ubuntu@51.89.231.46
cd /opt/00-infrastructure/atlassian

# Option 1: Interactive menu
./atlassian-setup.sh

# Option 2: Direct phases
./atlassian-setup.sh phase1  # Verify setup
./atlassian-setup.sh phase2  # Create fields, components, filters
./atlassian-setup.sh phase3  # Confluence, dashboards, automation
```

## Scripts

### Phase 1 Scripts
- `01-generate-api-token.sh` - Generate and test API token
- `02-verify-team-members.sh` - Verify team access

### Phase 2 Scripts (Auto)
- `03-create-projects.sh` - Create projects (supports UI-assisted)
- `04-create-custom-fields.sh` - Create 25+ custom fields
- `05-create-components.sh` - Create 6 PROD components
- `06-create-filters.sh` - Create 20 saved filters

### Utilities
- `api-utils.sh` - API helper functions
- `atlassian-setup.sh` - Master control script

## API Endpoints Used

```
Authentication: Basic Auth (Base64 email:token)

Jira API v3:
- GET /rest/api/3/project/search
- GET /rest/api/3/project/{projectKey}
- POST /rest/api/3/customfield
- POST /rest/api/3/component
- POST /rest/api/3/filter
- GET /rest/api/3/dashboard

Confluence API:
- POST /wiki/rest/api/space
- POST /wiki/rest/api/content
```

Reference: https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/

## Team

- Vadym Samoilenko (v.samoilenko@ai-impress.com) - Site Admin
- Pavlo Gulyk (p.gulyk@ai-impress.com) - Project Member
- Oleksii Maslovets (o.maslovets@ai-impress.com) - Project Member
- Stanislava Klochok (s.klochok@ai-impress.com) - Project Member

## Free Plan

- Storage: 2GB (optimize: ~1GB expected usage)
- Automation: 100 rules/month (planned: 15)
- Users: 10 free (currently 4)
- Upgrade trigger: 10+ users or storage >1.8GB

## Timeline

| Week | Phase | Status |
|------|-------|--------|
| 1 | Foundation & Auth | ✓ COMPLETE |
| 1-2 | Projects & Fields | Manual UI + Auto API |
| 2 | Confluence | Pending |
| 3 | Dashboards & Automation | Pending |
| 4 | Integrations & Data | Pending |
| 5 | Portal & Training | Pending |

## Files

All scripts and files saved to:
- **Mac:** `/tmp/atlassian-setup/`
- **Server:** `/opt/00-infrastructure/atlassian/`
- **Synced:** Automatically via Syncthing

## Support

### API Test
```bash
source /opt/00-infrastructure/atlassian/.env.atlassian
curl -s -H "Authorization: Basic $JIRA_AUTH" \
  "${ATLASSIAN_SITE_URL}/rest/api/3/serverInfo"
```

### Check Status
```bash
/opt/00-infrastructure/atlassian/atlassian-setup.sh check
```

### View Config
```bash
/opt/00-infrastructure/atlassian/atlassian-setup.sh config
```

---

**Infrastructure Status:** ✅ READY FOR PHASE 2

**Next Action:** Create 4 projects in Atlassian UI, then run Phase 2 scripts

