fix(jira): campaign=Task, campaign tests=Sub-task, standalone tests=Task
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Root cause: Jira rejects Task-under-Task nesting ("Please select valid
parent issue"). Campaign tickets and test tickets were both created as
Task, so nesting test under campaign failed for all 62 APT32 tests.
Fix:
- JIRA_ISSUE_TYPE_CAMPAIGN: "Epic" -> "Task" (was unused, now used)
- JIRA_ISSUE_TYPE_SUBTASK: "Sub-task" (new config key)
- auto_create_campaign_issue: uses JIRA_ISSUE_TYPE_CAMPAIGN (Task)
- auto_create_test_issue: uses Sub-task when parent_ticket_override is
set (campaign context), Task otherwise (standalone)
Hierarchy: OFS-9107 -> Campaign (Task) -> Test (Sub-task)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,8 @@ class Settings(BaseSettings):
|
||||
JIRA_IS_CLOUD: bool = True
|
||||
JIRA_DEFAULT_PROJECT: str = ""
|
||||
JIRA_ISSUE_TYPE_TEST: str = "Task"
|
||||
JIRA_ISSUE_TYPE_CAMPAIGN: str = "Epic"
|
||||
JIRA_ISSUE_TYPE_CAMPAIGN: str = "Task"
|
||||
JIRA_ISSUE_TYPE_SUBTASK: str = "Sub-task"
|
||||
|
||||
# ── Tempo Integration ─────────────────────────────────────────────
|
||||
TEMPO_ENABLED: bool = False
|
||||
|
||||
@@ -393,7 +393,7 @@ def auto_create_campaign_issue(
|
||||
"project": {"key": project_key},
|
||||
"summary": f"[Aegis Campaign] {campaign.name}",
|
||||
"description": _build_campaign_description(campaign),
|
||||
"issuetype": {"name": settings.JIRA_ISSUE_TYPE_TEST},
|
||||
"issuetype": {"name": settings.JIRA_ISSUE_TYPE_CAMPAIGN},
|
||||
"labels": ["aegis", "campaign"],
|
||||
}
|
||||
|
||||
@@ -467,11 +467,18 @@ def auto_create_test_issue(
|
||||
try:
|
||||
jira = get_user_jira_client(actor, db)
|
||||
|
||||
# Tests nested under a campaign are Sub-tasks; standalone tests are Tasks
|
||||
issue_type = (
|
||||
settings.JIRA_ISSUE_TYPE_SUBTASK
|
||||
if parent_ticket_override
|
||||
else settings.JIRA_ISSUE_TYPE_TEST
|
||||
)
|
||||
|
||||
fields: dict = {
|
||||
"project": {"key": project_key},
|
||||
"summary": f"[Aegis] {mitre_id} — {test.name}",
|
||||
"description": _build_test_description(test, technique),
|
||||
"issuetype": {"name": settings.JIRA_ISSUE_TYPE_TEST},
|
||||
"issuetype": {"name": issue_type},
|
||||
"labels": ["aegis", "security-test", mitre_id.replace(".", "-")],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user