feat(jira): issue_type=Epic + AssigneeMap + CLI resync-jira-fields

Cambios:
- jiraConfig: nuevo campo AssigneeMap (kanban_user_id -> jira_accountId).
- jiraHandler.create() y update(): aplican fields.assignee={accountId} cuando
  card.AssigneeID esta en el map. NO se borra el assignee de Jira cuando no
  hay mapeo (evita pisar asignaciones manuales).
- resolveJiraAssignee: helper compartido.
- seed-jira-data: cambio issue_type default Tarea Tecnica -> Epic (board 33
  filtra issuetype=Epic). assignee_map inyectada con 3 mapeos confirmados:
    egutierrez (Enmaa)  -> 712020:2cf3b82f-... (Enmanuel Gutierrez Perez)
    amassaguer (alfon)  -> 712020:3f3ca9e1-... (Alfonso Massaguer Gomez)
    ntajuelo   (Nat)    -> 712020:feb5f7c5-... (Natalia Tajuelo Gomez)
- Nueva CLI 'kanban resync-jira-fields' con flags
    --set-issuetype/--set-assignee/--set-labels/--dry-run/--limit/--batch-size/--pause-sec
  Idempotente. PUT /rest/api/3/issue/{key} con los fields del config actual.
  Usado para patchear las 127 issues ya creadas con Tarea Tecnica -> Epic +
  assignee (donde mapea).
- Ejecutado: 127/127 OK, 0 fail. Board 33 ahora muestra 219 issues totales
  (92 Epics previas + 127 nuevas). Sample verificado contra Jira REST API.
This commit is contained in:
egutierrez
2026-05-29 14:52:48 +02:00
parent cd14e81487
commit c5113f75a5
4 changed files with 246 additions and 16 deletions
+18 -8
View File
@@ -70,16 +70,26 @@ func runSeedJiraData(args []string) error {
labelsMap := map[string][]string{
"Bloqueadas": {"blocked"},
}
// kanban user_id -> Jira accountId. Resolved via Jira /user/search; the
// three current data-team users keep stable IDs across sessions. New
// users added to the kanban must be added here (or the seed re-run with
// --pass-prefix overrides) so the dispatcher can route the assignee.
assigneeMap := map[string]string{
"6a75edc6e99d8405": "712020:2cf3b82f-47d6-4597-b0e9-ffaaf3a07cc3", // Enmaa -> Enmanuel Gutierrez Perez
"039c97acf1869393": "712020:3f3ca9e1-c86e-445e-979a-bc7b82a4f45d", // alfon -> Alfonso Massaguer Gómez
"9e91db261084d529": "712020:feb5f7c5-7643-4381-977c-d83c95ba4955", // Nat -> Natalia Tajuelo Gomez
}
cfg := JSONValue{
"base_url": baseURL,
"email": email,
"api_token": token,
"project_key": *project,
"board_id": *board,
"issue_type": "Tarea Técnica",
"status_map": statusMap,
"labels_map": labelsMap,
"base_url": baseURL,
"email": email,
"api_token": token,
"project_key": *project,
"board_id": *board,
"issue_type": "Epic",
"status_map": statusMap,
"labels_map": labelsMap,
"assignee_map": assigneeMap,
}
// Upsert by name. Module name is the human-friendly identifier; we treat