View Issue Details

IDProjectCategoryView StatusLast Update
0034410mantisbtapi restpublic2024-05-12 12:34
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.13.0 
Target Version2.26.2Fixed in Version2.26.2 
Summary0034410: REST API error reports incorrect field "version" when updating fixed in / target version with invalid value
Description

Given the following request

PATCH http://localhost/mantis/api/rest/issues/{{id}}
Authorization: {{token}}
Content-Type: application/json

{
  "target_version": {
    "name": "xxx"
  }
}

The API responds with 400 BAD REQUEST

{
  "message": "Version 'xxx' does not exist in project 'Test Project'.",
  "code": 29,
  "localized": "Invalid value for 'version'"
                                   ^ this should be 'target_version'
}
TagsNo tags attached.

Activities

dregad

dregad

2024-04-20 19:59

developer   ~0068844

PR https://github.com/mantisbt/mantisbt/pull/1997

dregad

dregad

2024-05-12 12:07

developer   ~0068930

This was finally merged separately from the PR.

Related Changesets

MantisBT: master-2.26 4859fc1f

2024-04-19 13:14

dregad


Details Diff
REST: Report correct field given invalid version

The ClientException was given a hardcoded 'version' instead of using the
$p_field_name parameter.

Fixes 0034410
Affected Issues
0034410
mod - api/soap/mc_api.php Diff File