Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated date time format per DGTF 8317

/rest/{version}/defects/search

Descriptor

Value

HTTP Method

POST

Description

Returns a filtered list of defects.

Required Permission

Read Access (Any Role)

Version Introduced

2.7.3

Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

A value of ‘application/json’ must be provided.

Authorization

APIKEY {apiKey}

Yes

API being used to execute API call.

Request POST Data Parameters

Note: Parameter dates are converted to UTC. When making a call, users should utilize UTC to match the database which saves dates saved in UTC.

Parameter

Value Type

Req.

Description

paging

page

Integer

No

By default defects are displayed 10 to a page. Changing this value will allow user to display the next set of 10 defects and so on.

maxResults

Integer

No

Maximum number of defects to be returned. By default this method will only return up to 10 defects.

daysOld

Integer

No

Age in days of defect(s).

hoursOld

Integer

No

Age in hours of defect(s).

agingModifier

String

No

Applies modifier to either daysOld or hoursOld parameter. Accepted values are "less" and "more".

agingDateType

String

No

Entering "created" will apply the search to the defect created date. Entering "status" will apply the search to the defect status updated date.

startDate

Date

No

Lower bound on defect dates. Format:

yyyy-MM-dd or Epoch time (in milliseconds).

 yyyy-mm-ddThh:mm:ss.SSSz
Example: 2019-01-01T12:00:00.000Z

endDate

Date

No

Upper bound on defect dates. Format:

yyyy-MM-dd or Epoch time (in milliseconds).

 yyyy-mm-ddThh:mm:ss.SSSz
Example: 2019-01-01T12:00:00.000Z

statusUpdatedStartDate

Date

No

Lower bound on defect updated dates. Format

: yyyy-MM-dd or Epoch time (in milliseconds).

: yyyy-mm-ddThh:mm:ss.SSSz
Example: 2019-01-01T12:00:00.000Z

statusUpdatedEndDate

Date

No

Upper bound on defect updated dates. Format

: yyyy-MM-dd or Epoch time (in milliseconds).

: yyyy-mm-ddThh:mm:ss.SSSz
Example: 2019-01-01T12:00:00.000Z

defects

List

No

Serialized list of defects by id or nativeId. Example: defects[0].id=1 or defects[0].nativeId=THREAD-1983

applicationDefectTracker

List

No

Serialized list of application defect trackers by id, projectName or projectId. Example: applicationDefectTracker[0].id=1 or applicationDefectTracker[0].projectName=ThreadFix or applicationDefectTracker[0].projectId = 1

statuses

List

No

Serialized list of defects by status. Example: statuses[0].status=Open

showActive

Boolean

No

Flag to show only active defects.

showOpen

Boolean

No

Flag to show only open defects.

showClosed

Boolean

No

Flag to show only closed defects.

Sample Call:

theme
Code Block
Eclipse
curl -H 'Accept: application/json' -H 'Authorization: APIKEY {apiKey}' -X POST --data 'showOpen=1' http://localhost:8080/threadfix/rest/latest/defects/search

Sample Output:

Eclipse
Code Block
theme
{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": [
        {
            "id": 40,
            "nativeId": "THREAD-18653",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18653",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 41,
            "nativeId": "THREAD-18654",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18654",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 42,
            "nativeId": "THREAD-18655",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18655",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 43,
            "nativeId": "THREAD-18656",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18656",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 44,
            "nativeId": "THREAD-18657",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18657",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 45,
            "nativeId": "THREAD-18658",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18658",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 46,
            "nativeId": "THREAD-18659",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18659",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 47,
            "nativeId": "THREAD-18660",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18660",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 48,
            "nativeId": "THREAD-18661",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18661",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        },
        {
            "id": 49,
            "nativeId": "THREAD-18662",
            "status": "Open",
            "category": null,
            "defectURL": "https://threadfix.atlassian.net/browse/THREAD-18662",
            "defectTrackerName": "JIRA - ThreadFix",
            "opened": true
        }
    ]
}




Page Tree
rootVulnerabilities API