{"record":{"id":"89d1c16439402bd0","repo":"SonarSource/sonarqube","slug":"issue-does-not-support-impact","errorCode":null,"errorMessage":"Issue does not support impact ","messagePattern":"Issue does not support impact ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java","lineNumber":162,"sourceCode":"    SearchResponseData response;\n    if (severity != null) {\n      response = setManualSeverity(session, issue, issueDto, severity, context);\n    } else {\n      response = setManualImpact(session, issue, issueDto, impact, context);\n    }\n    return response;\n  }\n\n  private SearchResponseData setManualImpact(DbSession session, DefaultIssue issue, IssueDto issueDto, String impact,\n    IssueChangeContext context) {\n    Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> effectiveImpacts = issueDto.getEffectiveImpacts();\n    Pair<SoftwareQuality, org.sonar.api.issue.impact.Severity> manualImpact = parseImpact(impact);\n\n    org.sonar.api.issue.impact.Severity manualImpactSeverity = manualImpact.getValue();\n    SoftwareQuality softwareQuality = manualImpact.getKey();\n\n    if (!effectiveImpacts.containsKey(softwareQuality)) {\n      throw new IllegalArgumentException(\"Issue does not support impact \" + softwareQuality);\n    }\n    createImpactsIfMissing(issue, effectiveImpacts);\n    if (issueFieldsSetter.setImpactManualSeverity(issue, softwareQuality, manualImpactSeverity, context)) {\n      String manualSeverity = null;\n      boolean severityHasChanged = false;\n      if (convertToRuleType(softwareQuality) == RuleTypeMapper.toApiRuleType(issue.type())) {\n        manualSeverity = convertToRuleSeverity(manualImpactSeverity);\n        severityHasChanged = issueFieldsSetter.setManualSeverity(issue, manualSeverity, context);\n      }\n      BranchDto branch = issueUpdater.getBranch(session, issue);\n      SearchResponseData response = issueUpdater.saveIssueAndPreloadSearchResponseData(session, issueDto, issue, context, branch);\n      if (branch.getBranchType().equals(BRANCH) && response.getComponentByUuid(issue.projectUuid()) != null) {\n        issueChangeEventService.distributeIssueChangeEvent(issue, severityHasChanged ? manualSeverity : null, Map.of(softwareQuality, manualImpactSeverity), null, null,\n          branch, getProjectKey(issue, response));\n      }\n      return response;\n    }\n    return new SearchResponseData(issueDto);","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java#L144-L180","documentation":"Thrown when setting severity via impact: the requested impact's SoftwareQuality is not among the issue's effective impacts. Only qualities the issue already carries (derived from its rule/type) can have their manual severity changed.","triggerScenarios":"Calling POST api/issues/set_severity with impact=SECURITY,MAJOR (or similar) where the given SoftwareQuality is not present in the issue's impacts; e.g. requesting MAINTAINABILITY impact on an issue whose rule maps only to RELIABILITY.","commonSituations":"Automation applying a fixed impact payload to arbitrary issues; rule changes altering which impacts an issue supports; mixing legacy severity with the new MQR impact model on mismatched issue types.","solutions":["Check the issue's current impacts (GET api/issues/show, impacts field) and only pass qualities listed there","Use the 'severity' parameter instead if you just want classic severity mapping","Pick a SoftwareQuality that corresponds to the issue's rule type"],"exampleFix":"// before\npost('/api/issues/set_severity', {issue: key, impact: 'MAINTAINABILITY,HIGH'}); // issue is RELIABILITY-only\n// after\nconst {issue} = await get('/api/issues/show', {key});\nconst q = issue.impacts[0].softwareQuality;\npost('/api/issues/set_severity', {issue: key, impact: q + ',HIGH'});","handlingStrategy":"validation","validationCode":"const {issue} = await get('/api/issues/show', {key});\nconst supported = issue.impacts.map(i => i.softwareQuality);\nif (!supported.includes(requestedQuality)) throw new Error(`issue does not support impact ${requestedQuality}`);","typeGuard":null,"tryCatchPattern":"try { await post('/api/issues/set_severity', {issue: key, impact}); } catch (e) { if (e.status === 400 && e.message.startsWith('Issue does not support impact')) { /* use a supported quality or the severity param */ } else throw e; }","preventionTips":["Read the issue's impacts before setting impact severity","Derive impact quality from the issue's rule type","Prefer the legacy severity param for simple cases"],"tags":["sonarqube","issues","mqr","impacts"],"backgroundTag":"invalid-argument-value","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}