---
ai:
  exclude: true
search:
  tags:
    - search
    - POST
seo:
  description: >-
    Performs a search using JQL. Reference for the POST /api/2/search endpoint
    in the Jira Software Data Center REST API Reference.
sidebar:
  label: Perform search with JQL
  badge: POST
title: Perform search with JQL
type: openapi-operation
---
Performs a search using JQL.

`POST /api/2/search`

**Request body** (`application/json`, required)

a JSON object containing the search request

- `expand` (string[])
- `fields` (string[])
- `jql` (string)
- `maxResults` (integer<int32>)
- `startAt` (integer<int32>)
- `validateQuery` (boolean)

Request body example:

```json
{
  "expand": [
    "transitions",
    "changelog",
    "operations",
    "editmeta",
    "versionedRepresentations",
    "renderedFields"
  ],
  "fields": [
    "summary",
    "status",
    "assignee"
  ],
  "jql": "project = HSP",
  "maxResults": 15,
  "startAt": 0,
  "validateQuery": false
}
```

**Responses**

- `200` — Returns a JSON representation of the search results.
- `400` — Returned if there is a problem with the JQL query.

Response example, 200:

```json
{
  "expand": "0",
  "issues": [
    {
      "changelog": {
        "histories": [
          {
            "author": {
              "active": true,
              "avatarUrls": "http://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10000",
              "displayName": "Fred F. User",
              "emailAddress": "fred@example.com",
              "key": "fred",
              "name": "Fred",
              "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
              "timeZone": "Australia/Sydney"
            },
            "created": "2019-08-24T14:15:22Z",
            "historyMetadata": {
              "activityDescription": "text description",
              "activityDescriptionKey": "plugin.activity.i18.key",
              "actor": {
                "avatarUrl": "http://mysystem.com/avatar/tony.jpg",
                "displayName": "Tony",
                "displayNameKey": "tony",
                "id": "tony",
                "type": "mysystem-user",
                "url": "http://mysystem.com/user/tony"
              },
              "cause": {
                "avatarUrl": "http://mysystem.com/avatar/tony.jpg",
                "displayName": "Tony",
                "displayNameKey": "tony",
                "id": "tony",
                "type": "mysystem-user",
                "url": "http://mysystem.com/user/tony"
              },
              "description": "The issue was created.",
              "descriptionKey": "plugin.changereason.i18.key",
              "emailDescription": "email description",
              "emailDescriptionKey": "plugin.email.i18.key",
              "extraData": {
                "keyvalue": "extra data",
                "goes": "here"
              },
              "generator": {
                "avatarUrl": "http://mysystem.com/avatar/tony.jpg",
                "displayName": "Tony",
                "displayNameKey": "tony",
                "id": "tony",
                "type": "mysystem-user",
                "url": "http://mysystem.com/user/tony"
              },
              "type": "myplugin:type"
            },
            "id": "string",
            "items": [
              {
                "field": "string",
                "fieldtype": "string",
                "from": "string",
                "fromString": "string",
                "to": "string",
                "toString": "string"
              }
            ]
          }
        ],
        "maxResults": 0,
        "startAt": 0,
        "total": 0
      },
      "editmeta": {},
      "fields": {
        "watcher": {
          "self": "http://www.example.com/jira/rest/api/2/issue/EX-1/watchers",
          "isWatching": false,
          "watchCount": 1,
          "watchers": [
            {
              "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
              "name": "fred",
              "displayName": "Fred F. User",
              "active": false
            }
          ]
        },
        "attachment": [
          {
            "self": "http://www.example.com/jira/rest/api/2.0/attachments/10000",
            "filename": "picture.jpg",
            "author": {
              "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
              "key": "JIRAUSER10100",
              "name": "fred",
              "emailAddress": "fred@example.com",
              "avatarUrls": {
                "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred",
                "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred",
                "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred",
                "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred"
              },
              "displayName": "Fred F. User",
              "active": true,
              "deleted": false,
              "timeZone": "Australia/Sydney",
              "locale": "en_AU",
              "lastLoginTime": "2023-08-30T16:37:01+1000"
            },
            "created": "2024-05-23T14:47:28.592+0000",
            "size": 23123,
            "mimeType": "image/jpeg",
            "content": "http://www.example.com/jira/attachments/10000",
            "thumbnail": "http://www.example.com/jira/secure/thumbnail/10000"
          }
        ],
        "sub-tasks": [
          {
            "id": "10000",
            "type": {
              "id": "10000",
              "name": "",
              "inward": "Parent",
              "outward": "Sub-task"
            },
            "outwardIssue": {
              "id": "10003",
              "key": "EX-2",
              "self": "http://www.example.com/jira/rest/api/2/issue/EX-2",
              "fields": {
                "status": {
                  "iconUrl": "http://www.example.com/jira//images/icons/statuses/open.png",
                  "name": "Open"
                }
              }
            }
          }
        ],
        "description": "example bug report",
        "project": {
          "self": "http://www.example.com/jira/rest/api/2/project/EX",
          "id": "10000",
          "key": "EX",
          "name": "Example",
          "avatarUrls": {
            "48x48": "http://www.example.com/jira/secure/projectavatar?size=large&pid=10000",
            "24x24": "http://www.example.com/jira/secure/projectavatar?size=small&pid=10000",
            "16x16": "http://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10000",
            "32x32": "http://www.example.com/jira/secure/projectavatar?size=medium&pid=10000"
          },
          "projectCategory": {
            "self": "http://www.example.com/jira/rest/api/2/projectCategory/10000",
            "id": "10000",
            "name": "FIRST",
            "description": "First Project Category"
          }
        },
        "comment": [
          {
            "self": "http://www.example.com/jira/rest/api/2/issue/10010/comment/10000",
            "id": "10000",
            "author": {
              "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
              "name": "fred",
              "displayName": "Fred F. User",
              "active": false
            },
            "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
            "updateAuthor": {
              "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
              "name": "fred",
              "displayName": "Fred F. User",
              "active": false
            },
            "created": "2024-05-23T14:47:28.538+0000",
            "updated": "2024-05-23T14:47:28.538+0000",
            "visibility": {
              "type": "role",
              "value": "Administrators"
            }
          }
        ],
        "issuelinks": [
          {
            "id": "10001",
            "type": {
              "id": "10000",
              "name": "Dependent",
              "inward": "depends on",
              "outward": "is depended by"
            },
            "outwardIssue": {
              "id": "10004L",
              "key": "PRJ-2",
              "self": "http://www.example.com/jira/rest/api/2/issue/PRJ-2",
              "fields": {
                "status": {
                  "iconUrl": "http://www.example.com/jira//images/icons/statuses/open.png",
                  "name": "Open"
                }
              }
            }
          },
          {
            "id": "10002",
            "type": {
              "id": "10000",
              "name": "Dependent",
              "inward": "depends on",
              "outward": "is depended by"
            },
            "inwardIssue": {
              "id": "10004",
              "key": "PRJ-3",
              "self": "http://www.example.com/jira/rest/api/2/issue/PRJ-3",
              "fields": {
                "status": {
                  "iconUrl": "http://www.example.com/jira//images/icons/statuses/open.png",
                  "name": "Open"
                }
              }
            }
          }
        ],
        "worklog": [
          {
            "self": "http://www.example.com/jira/rest/api/2/issue/10010/worklog/10000",
            "author": {
              "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
              "name": "fred",
              "displayName": "Fred F. User",
              "active": false
            },
            "updateAuthor": {
              "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
              "name": "fred",
              "displayName": "Fred F. User",
              "active": false
            },
            "comment": "I did some work here.",
            "updated": "2024-05-23T14:47:28.599+0000",
            "visibility": {
              "type": "group",
              "value": "jira-developers"
            },
            "started": "2024-05-23T14:47:28.598+0000",
            "timeSpent": "3h 20m",
            "timeSpentSeconds": 12000,
            "id": "100028",
            "issueId": "10002"
          }
        ],
        "updated": 1,
        "timetracking": {
          "originalEstimate": "10m",
          "remainingEstimate": "3m",
          "timeSpent": "6m",
          "originalEstimateSeconds": 600,
          "remainingEstimateSeconds": 200,
          "timeSpentSeconds": 400
        }
      },
      "fieldsToInclude": {
        "included": [
          "string"
        ]
      },
      "id": "10000",
      "key": "HSP-1",
      "names": {
        "property1": "string",
        "property2": "string"
      },
      "operations": {
        "linkGroups": [
          {
            "groups": [
              {}
            ],
            "header": {
              "href": "/secure/EditIssue!default.jspa?id=10000",
              "iconClass": "aui-icon aui-icon-small aui-iconfont-edit",
              "id": "edit-issue",
              "label": "Edit",
              "params": "{'iconClass':'aui-icon aui-icon-small aui-iconfont-edit'}",
              "styleClass": "edit-cls",
              "title": "Click to Edit the Issue",
              "weight": 1
            },
            "id": "string",
            "links": [
              {
                "href": "/secure/EditIssue!default.jspa?id=10000",
                "iconClass": "aui-icon aui-icon-small aui-iconfont-edit",
                "id": "edit-issue",
                "label": "Edit",
                "params": "{'iconClass':'aui-icon aui-icon-small aui-iconfont-edit'}",
                "styleClass": "edit-cls",
                "title": "Click to Edit the Issue",
                "weight": 1
              }
            ],
            "styleClass": "string",
            "weight": 0
          }
        ]
      },
      "properties": {
        "properties": {
          "property1": "string",
          "property2": "string"
        }
      },
      "renderedFields": {
        "property1": {},
        "property2": {}
      },
      "schema": {
        "property1": {},
        "property2": {}
      },
      "self": "https://jira.atlassian.com/rest/api/2/issue/10000",
      "transitions": [
        {
          "description": "Close the issue.",
          "fields": {
            "property1": {
              "allowedValues": [
                "red",
                "blue",
                "default value"
              ],
              "autoCompleteUrl": "/rest/api/2/customFieldOption/10000",
              "defaultValue": {},
              "fieldId": "customfield_10000",
              "hasDefaultValue": true,
              "name": "My Multi Select",
              "operations": [
                "set",
                "add"
              ],
              "required": true,
              "schema": {}
            },
            "property2": {
              "allowedValues": [
                "red",
                "blue",
                "default value"
              ],
              "autoCompleteUrl": "/rest/api/2/customFieldOption/10000",
              "defaultValue": {},
              "fieldId": "customfield_10000",
              "hasDefaultValue": true,
              "name": "My Multi Select",
              "operations": [
                "set",
                "add"
              ],
              "required": true,
              "schema": {}
            }
          },
          "id": "2",
          "name": "Close Issue",
          "opsbarSequence": 10,
          "to": {
            "description": "The issue is currently being worked on.",
            "iconUrl": "http://localhost:8090/jira/images/icons/progress.gif",
            "id": "10000",
            "name": "In Progress",
            "self": "http://localhost:8090/jira/rest/api/2.0/status/10000",
            "statusCategory": {
              "colorName": "blue-gray",
              "id": 1,
              "key": "new",
              "name": "To Do",
              "self": "http://localhost:8090/jira/rest/api/2.0/statuscategory/1"
            },
            "statusColor": "green"
          }
        }
      ],
      "versionedRepresentations": {
        "property1": {
          "property1": {},
          "property2": {}
        },
        "property2": {
          "property1": {},
          "property2": {}
        }
      }
    }
  ],
  "maxResultWindow": 10000,
  "maxResults": 50,
  "names": {},
  "schema": {},
  "startAt": 0,
  "total": 1,
  "warningMessages": []
}
```
