Skip to content
atlassian-dc-mcp
Esc
↑↓navigate↵open⌘Jpreview

Get issues using JQL

Searches for issues using JQL. Sorting the jql parameter is a full <a href=“http://confluence.atlassian.com/display/JIRA/Advanced+Searching">JQL&lt;/a> expression, and includes an ORDER BY clause. The fields param (which can be specified multiple times) gives a comma-separated list of fields to include in the response. This can be used to retrieve a subset of fields. A particular field can be excluded by prefixing it with a minus. By default, only navigable (*navigable) fields are returned in this search resource. Note: the default is different in the get-issue resource – the default there all fields (*all). *all - include all fields *navigable - include just navigable fields summary,comment - include just the summary and comments -description - include navigable fields except the description (the default is *navigable for search) *all,-comment - include everything except comments GET vs POST: If the JQL query is too large to be encoded as a query param you should instead POST to this resource. Expanding Issues in the Search Result: It is possible to expand the issues returned by directly specifying the expansion on the expand parameter passed in to this resources. For instance, to expand the changelog for all the issues on the search result, it is necessary to specify changelog as one of the values to expand.

GET/api/2/search
Authorization
AuthorizationBasic auth · headerrequired

In order to use basic authorization, provide username:password Base64 encoded in the 'Authorization' header.

or
AuthorizationBearer token · headerrequired

Personal Access Token — Administration > Profile > Personal Access Tokens

AuthorizationBasic auth · headerrequired

In order to use basic authorization, provide username:password Base64 encoded in the 'Authorization' header.

Query parameters
expandStringList

A comma-separated list of the parameters to expand

jqlstring

a JQL query string

maxResultsinteger<int32>

the maximum number of issues to return (defaults to 50)

validateQueryboolean

whether to validate the JQL query

default: true
fieldsStringList[]

the list of fields to return for each issue

startAtinteger<int32>

the index of the first issue to return (0-based)

Responses
200

Returns a JSON representation of the search results.

expandstring
issuesIssueBean[]
Show properties
Array of IssueBean
changelogChangelogBean
Show properties
historiesChangeHistoryBean[]
Show properties
Array of ChangeHistoryBean
authorUserJsonBean
Show properties
activeboolean
avatarUrlsobject
displayNamestring
emailAddressstring
keystring
namestring
selfstring
timeZonestring
createdstring<date-time>
historyMetadataHistoryMetadata
Show properties
activityDescriptionstring
activityDescriptionKeystring
actorHistoryMetadataParticipant
Show properties
avatarUrlstring
displayNamestring
displayNameKeystring
idstring
typestring
urlstring
causeHistoryMetadataParticipant
descriptionstring
descriptionKeystring
emailDescriptionstring
emailDescriptionKeystring
extraDataobject
generatorHistoryMetadataParticipant
typestring
idstring
itemsChangeItemBean[]
Show properties
Array of ChangeItemBean
fieldstring
fieldtypestring
fromstring
fromStringstring
tostring
toStringstring
maxResultsinteger<int32>
startAtinteger<int32>
totalinteger<int32>
editmetaEditMetaBean
fieldsobject
fieldsToIncludeIncludedFields
Show properties
includedstring[]
idstring
keystring
namesobject
operationsOpsbarBean
Show properties
linkGroupsLinkGroupBean[]
Show properties
Array of LinkGroupBean
groupsLinkGroupBean[]
Show properties
Array of LinkGroupBean
Circular reference to LinkGroupBean.
headerSimpleLinkBean
Show properties
hrefstring
iconClassstring
idstring
labelstring
paramsobject
styleClassstring
titlestring
weightinteger<int32>
idstring
linksSimpleLinkBean[]
styleClassstring
weightinteger<int32>
propertiesPropertiesBean
Show properties
propertiesobject
renderedFieldsobject
schemaobject
selfstring<uri>
transitionsTransitionBean[]
Show properties
Array of TransitionBean
descriptionstring
fieldsobject
idstring
namestring
opsbarSequenceinteger<int32>
toStatusJsonBean
Show properties
descriptionstring
iconUrlstring
idstring
namestring
selfstring
statusCategoryStatusCategoryJsonBean
Show properties
colorNamestring
idinteger<int64>
keystring
namestring
selfstring
statusColorstring
versionedRepresentationsobject
maxResultWindowinteger<int32>

The maximum number of results that can be retrieved from the underlying search engine, or null if unlimited

maxResultsinteger<int32>

The number of results to return in this page.

namesobject
schemaobject
startAtinteger<int32>
totalinteger<int32>
warningMessagesstring[]
400

Returned if there is a problem with the JQL query.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://jira.example.com/rest/api/2/search' \
  -H 'Authorization: Basic YOUR_CREDENTIALS' \
  -H 'Accept: application/json'
Response
{
  "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": []
}

Was this page helpful?