Issues

GET /issues #

Get issues

Returns issues visible to the effective user. Use project_id to scope the search and filter_id for a built-in or saved filter. Results are paginated; omit select to use the default issue fields.

Parameters

Name In Type Description
project_id query integer e.g. 1
filter_id query string
page_size query integer
page query integer e.g. 1
select query string e.g. id,summary,description

Responses

  • 200 Success X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
cURL
curl -X GET \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues
POST /issues #

Create an issue

When creating an issue, most of the fields other than summary, description and category are typically optional. It is also worth noting that when passing references to enumerations like priority or object references like handler, it is sufficient to pass the id or name.

Request body required

summary string
description string
steps_to_reproduce string
additional_information string
project object
name string
category object
name string
handler object
name string
email string
view_state object
id number
name string
label string
priority object
id number
name string
label string
severity object
id number
name string
label string
reproducibility object
id number
name string
label string
sticky boolean sticky issues show at the top of the View Issues page.
files object[]
name string
content string
custom_fields object[]
field object
id number
name string
value string

Responses

  • 201 Resource created successfully X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
cURL
curl -X POST \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  -H "Content-Type: application/json" \
  https://yourmantishubname.mantishub.io/api/rest/issues \
  -d '{
    "summary": "This is a summary",
    "description": "This is a description.  \nIt can be multiline.\n",
    "steps_to_reproduce": "This is steps to reproduce.  \nIt can be multiline.\n",
    "additional_information": "This is additional information.  \nIt can be multiline.\n",
    "project": {
        "name": "MantisBT"
    },
    "category": {
        "name": "Authn"
    },
    "handler": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "view_state": {
        "id": 10,
        "name": "public",
        "label": "Public"
    },
    "priority": {
        "id": 40,
        "name": "high",
        "label": "High"
    },
    "severity": {
        "id": 60,
        "name": "major",
        "label": "Major"
    },
    "reproducibility": {
        "id": 10,
        "name": "always",
        "label": "Always"
    },
    "sticky": true,
    "files": [
        {
            "name": "string",
            "content": "string"
        }
    ],
    "custom_fields": [
        {
            "field": {
                "id": 1,
                "name": "string"
            },
            "value": "string"
        }
    ]
}'
Request body · application/json
{
    "summary": "This is a summary",
    "description": "This is a description.  \nIt can be multiline.\n",
    "steps_to_reproduce": "This is steps to reproduce.  \nIt can be multiline.\n",
    "additional_information": "This is additional information.  \nIt can be multiline.\n",
    "project": {
        "name": "MantisBT"
    },
    "category": {
        "name": "Authn"
    },
    "handler": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "view_state": {
        "id": 10,
        "name": "public",
        "label": "Public"
    },
    "priority": {
        "id": 40,
        "name": "high",
        "label": "High"
    },
    "severity": {
        "id": 60,
        "name": "major",
        "label": "Major"
    },
    "reproducibility": {
        "id": 10,
        "name": "always",
        "label": "Always"
    },
    "sticky": true,
    "files": [
        {
            "name": "string",
            "content": "string"
        }
    ],
    "custom_fields": [
        {
            "field": {
                "id": 1,
                "name": "string"
            },
            "value": "string"
        }
    ]
}
GET /issues/{issue_id} #

Get an issue

Returns one visible issue. The response includes an ETag; use it with If-Match when subsequently updating or deleting the issue.

Parameters

Name In Type Description
issue_id required path integer The issue ID e.g. 123
If-None-Match header string ETag returned by a prior issue read. A matching value returns 304 without a response body.
select query string e.g. id,summary,description

Responses

  • 200 Success X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 304 The requested issue has not changed since the supplied ETag. ETag
  • 400 Bad Request
  • 404 Entity not found
cURL
curl -X GET \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123
PATCH /issues/{issue_id} #

Update an issue

Applies the supplied fields to an existing issue. For optimistic concurrency, first read the issue and send its ETag in If-Match. A mismatch returns 412 Precondition Failed.

Parameters

Name In Type Description
issue_id required path integer The issue ID e.g. 123
If-Match header string ETag returned by a prior issue read. The operation fails with 412 if it no longer matches.

Request body required

summary string
priority object
name string
handler object
name string
status object
name string
custom_fields object[]
field object
name string
value string
notes object[]
id number
reporter object
name string
text string
view_state object
id number
name string
label string

Responses

  • 200 Success X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
  • 412 The supplied If-Match value does not match the current issue ETag. ETag
cURL
curl -X PATCH \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  -H "Content-Type: application/json" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123 \
  -d '{
    "summary": "string",
    "priority": {
        "name": "string"
    },
    "handler": {
        "name": "string"
    },
    "status": {
        "name": "string"
    },
    "custom_fields": [
        {
            "field": {
                "name": "string"
            },
            "value": "string"
        }
    ],
    "notes": [
        {
            "id": 1,
            "reporter": {
                "name": "string"
            },
            "text": "string",
            "view_state": {
                "id": 1,
                "name": "string",
                "label": "string"
            }
        }
    ]
}'
Request body · application/json
{
    "summary": "string",
    "priority": {
        "name": "string"
    },
    "handler": {
        "name": "string"
    },
    "status": {
        "name": "string"
    },
    "custom_fields": [
        {
            "field": {
                "name": "string"
            },
            "value": "string"
        }
    ],
    "notes": [
        {
            "id": 1,
            "reporter": {
                "name": "string"
            },
            "text": "string",
            "view_state": {
                "id": 1,
                "name": "string",
                "label": "string"
            }
        }
    ]
}
DELETE /issues/{issue_id} #

Delete an issue

Deletes an issue. Supply the current ETag in If-Match to ensure that the issue was not changed after it was read.

Parameters

Name In Type Description
issue_id required path integer The issue ID e.g. 123
If-Match header string ETag returned by a prior issue read. The operation fails with 412 if it no longer matches.

Responses

  • 204 Operation completed successfully with no response body X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
  • 412 The supplied If-Match value does not match the current issue ETag. ETag
cURL
curl -X DELETE \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123