How to find distinct values for a Field in JIRA

Saraswathi Vepa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2024

Hello, I am looking for a query or filter to list all distinct values for a field called Domain (its a Dropbox) in a JIRA Project. Can someone help me? 

4 answers

1 vote
Robert Wen_Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2024

Hello @Saraswathi Vepa ! Welcome to the Atlassian Community!

JQL queries won't get what you're looking for.  You may want to do this using the REST API.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-get

David Nickell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2024

always like to see a REST API solution :-).   Since these are GET calls, you can submit them in a browser.    you might need three calls as follows:

1. Search fields based on the name.  In your case you will use your URL and the term "Domain".   These are all case sensitive so be sure to spell it correctly

https://splitdimedata.atlassian.net/rest/api/3/field/search?query=SDD

Results: 

{
  "maxResults": 50,
  "startAt": 0,
  "total": 1,
  "isLast": true,
  "values": [
    {
      "id": "customfield_10067",
      "name": "SDD_Client",
      "schema": {
        "type": "array",
        "items": "option",
        "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes",
        "customId": 10067
      },
      "description": "Client Impacted"
    }
  ]
}

 

2. I used the custom id to get the valid contexts:  

https://splitdimedata.atlassian.net/rest/api/3/field/customfield_10067/context

Results:

{
  "maxResults": 50,
  "startAt": 0,
  "total": 1,
  "isLast": true,
  "values": [
    {
      "id": "10184",
      "name": "Default Configuration Scheme for SDD_Client",
      "description": "Default configuration scheme generated by Jira",
      "isGlobalContext": true,
      "isAnyIssueType": true
    }
  ]
}

 

Finally, the call mentioned by the person who provided the original answer:

https://splitdimedata.atlassian.net/rest/api/3/field/customfield_10067/context/10184/option

{
  "maxResults": 100,
  "startAt": 0,
  "total": 4,
  "isLast": true,
  "values": [
    {
      "id": "10048",
      "value": "Caterpillar (Fred)",
      "disabled": false
    },
    {
      "id": "10049",
      "value": "Utility Client (Wilma)",
      "disabled": false
    },
    {
      "id": "10050",
      "value": "Atlanta (Barney)",
      "disabled": false
    },
    {
      "id": "10051",
      "value": "West Coast (Betty)",
      "disabled": false
    }
  ]
}

 

0 votes
Tom Mike
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 1, 2024

Although JQL lacks a built-in feature for directly listing different values, you can evaluate the results by filtering issues by a particular field:

Go to Advanced Issue Search under Filters.
Execute the following JQL query: project = "ProjectName" BUY USING "CustomField"
Export the results to a CSV file (if the list is long) and use a tool like Excel or Google Sheets to find distinct values.
Please accept the answer if you feel this as solution for you. Thanks

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2024

Where did you get that JQL Query? That will not work. 

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2024

Hi Saraswathi - Welcome to the Atlassian Community!

When you say it is a dropbox field - do you mean drop down? 

If so, just create a filter that shows all issues on the project - simple as Project = ABC. Save that filter.  

Then create a dashboard or use an existing dashboard and add a gadget for Issue Statistics. Use the Domain field for the Statistic. This will show you all of the unique values. 

0 votes
Ramakrishna (RK)
Contributor
November 30, 2024

Hi @Saraswathi Vepa ,

Welcome to Atlassian Community !!

As @Robert Wen_Cprime_ mentioned JQL itself doesn't have a built-in function for directly listing distinct values, but you can filter issues by a specific field and review the results:

  • Navigate to Filters > Advanced Issue Search.
  • Run a JQL query like:
    project = "ProjectName" ORDER BY "CustomField"
  • Export the results to a CSV file (if the list is long) and use a tool like Excel or Google Sheets to find distinct values.

 Please accept the answer if you feel this as solution for you. Thanks!

 

Regards

RK

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events