DEV Community

Cover image for How does one JQL with the Jira API?

How does one JQL with the Jira API?

Lorna Watson
Software Engineer from Leeds, UK. Easy-going, keen learner & motivated by all-things dev. ✨
・3 min read

This post is to document, for myself to remember, but also for others who are looking to play with the Jira API - more specifically JQL. I've wrote a list of useful queries here.

The following example assumes:


Get list of bugs in TestProject in current sprint for Avengers team


Generate an API token here and copy it somewhere for safe keeping as you're going to need it in a moment.

In the "Authorization" tab, select "Basic Auth" as type with your email address as username and the token you just generated as the password.

Request URL (GET): AND issuetype = "Bug" AND Sprint in openSprints() AND "Engineering Team[Dropdown]" = TSTP-Avengers

Where query params are:

Key Value
jql project=TSTP AND issuetype = "Bug" AND Sprint in openSprints() AND "Engineering Team[Dropdown]" = TSTP-Avengers

JSON Response

You'll get back a hefty JSON response which I believe you can filter (not looked into this yet). Please note I've heavily removed bits to focus on the main juicy data you get back without boring the page too much. There are loads of custom fields returned where I believe (again, not looked into this as yet) you can check on your Jira account for a list/create some more.

  "expand": "schema,names",
  "startAt": 0,
  "maxResults": 50,
  "total": 1,
  "issues": [
      "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields,",
      "id": "44421",
      "self": "",
      "key": "TSTP-5980",
      "fields": {
        "resolution": {
          "self": "",
          "id": "10000",
          "description": "Work has been completed on this issue.",
          "name": "Done"
        "lastViewed": "2021-05-19T09:10:22.953+0100",
        "labels": [
          "Tech Debt"
        "assignee": {
          "displayName": "Lorna Watson"
        "reporter": {
          "displayName": "Bob Smith"
        "customfield_15725": {
          "released": true,
          "releaseDate": "2017-10-25"
        "issuetype": {
          "self": "",
          "id": "1",
          "description": "A problem which impairs or prevents the functions of the product.",
          "iconUrl": "",
          "name": "Bug",
          "subtask": false,
          "avatarId": 1223
        "project": {
          "self": "",
          "id": "1450",
          "key": "TSTP",
          "name": "TestProject",
          "avatarUrls": {
            "48x48": "",
            "24x24": "",
            "16x16": "",
            "32x32": ""
          "projectCategory": {
            "self": "",
            "id": "10200",
            "description": "Used by ABC TestProject",
            "name": "ABC TestProject"
        "resolutiondate": "2021-05-19T09:10:22.982+0100",
        "updated": "2021-05-19T14:40:38.903+0100",
        "description": "Details of task item will be shown here",
        "customfield_10007": [
            "id": 35,
            "name": "Sprint 1 (Avengers)",
            "state": "active",
            "boardId": 1,
            "startDate": "2021-05-10T07:00:00.000Z",
            "endDate": "2021-05-21T16:30:00.000Z"
        "priority": {
          "name": "Sev 2",
          "id": "4"
        "status": {
          "self": "",
          "description": "",
          "iconUrl": "",
          "name": "Complete",
          "id": "1086",
          "statusCategory": {
            "self": "",
            "id": 1,
            "key": "done",
            "colorName": "green",
            "name": "Done"
        "creator": {
          "displayName": "Bob Smith"
        "customfield_14006": {
          "self": "",
          "value": "Pending",
          "id": "11734"
        "customfield_13710": "Some more details",
        "customfield_13702": {
          "self": "",
          "value": "Not Reviewed",
          "id": "11512"
        "created": "2017-12-12T11:07:34.517+0000",
        "customfield_12600": "{pullrequest={dataType=pullrequest, state=MERGED, stateCount=1}, json={\"cachedValue\":{\"errors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":1,\"lastUpdated\":\"2021-05-18T16:48:41.146+0100\",\"stateCount\":1,\"state\":\"MERGED\",\"dataType\":\"pullrequest\",\"open\":false},\"byInstanceType\":{\"bitbucket\":{\"count\":1,\"name\":\"Bitbucket Cloud\"}}}}},\"isStale\":true}}"
Enter fullscreen mode Exit fullscreen mode

All good to go.

I hope this was useful, I found it painful to get it to this stage with not being much (IMO) documentation and tutorials on using JQL for Jira API requests. Thank you!!

Discussion (0)