fix(jira): fill required 'Área Solicitante' on Epic create
Project DATA's Epic and Mejora issue types mark customfield_10158
('Área Solicitante', a single-select) as required on the create screen.
The create payload omitted it, so enabling card.created sync produced
HTTP 400 'Solicitante is required'.
Add RequesterField/RequesterMap/RequesterDefault to jiraConfig. create()
and update() now inject the field as a {value:<option>} single-select,
resolved from the card requester via the map (case-insensitive) or the
default. Kanban requesters are person names, not departments, so cards
fall through to requester_default ('Transformación' for our setup).
seed-jira-data gains --requester-field (default customfield_10158) and
--requester-default (default Transformación); the existing-module branch
now merges config so operator UI edits (e.g. a requester_map) survive a
re-seed. Validated against Jira: Epic create with the field succeeds 201
(reporter auto-defaults to the token owner).
This commit is contained in:
+16
-1
@@ -33,6 +33,10 @@ func runSeedJiraData(args []string) error {
|
||||
"Comma-separated event types this module subscribes to")
|
||||
enabled := fs.Bool("enabled", true, "Start with module enabled (true) or disabled (false)")
|
||||
passEntry := fs.String("pass-prefix", "jira/anjana", "pass entry prefix; reads ${prefix}/{email,api-token,domain}")
|
||||
requesterField := fs.String("requester-field", "customfield_10158",
|
||||
"Jira custom field id for the required 'Área Solicitante' select (empty to disable)")
|
||||
requesterDefault := fs.String("requester-default", "Transformación",
|
||||
"Default 'Área Solicitante' option value for auto-created cards whose requester is not mapped")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -91,6 +95,10 @@ func runSeedJiraData(args []string) error {
|
||||
"labels_map": labelsMap,
|
||||
"assignee_map": assigneeMap,
|
||||
}
|
||||
if *requesterField != "" {
|
||||
cfg["requester_field"] = *requesterField
|
||||
cfg["requester_default"] = *requesterDefault
|
||||
}
|
||||
|
||||
// Upsert by name. Module name is the human-friendly identifier; we treat
|
||||
// it as unique for the purposes of seeding so re-running this command does
|
||||
@@ -111,7 +119,14 @@ func runSeedJiraData(args []string) error {
|
||||
existing.Kind = "jira"
|
||||
existing.Enabled = *enabled
|
||||
existing.EventFilter = splitCSV(*filter)
|
||||
existing.Config = cfg
|
||||
// Merge so keys the operator added via the UI (e.g. a custom
|
||||
// requester_map) survive a re-seed. Seed-managed keys are refreshed.
|
||||
if existing.Config == nil {
|
||||
existing.Config = JSONValue{}
|
||||
}
|
||||
for k, v := range cfg {
|
||||
existing.Config[k] = v
|
||||
}
|
||||
if err := db.saveModule(existing); err != nil {
|
||||
return fmt.Errorf("update module: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user