Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Are there any API interfaces that support fuzzy search for projects?

RUI HAN June 23, 2025

I tried using this REST API.

>Jira 9.16.0

The API I'm using only allows prefix-based search for projects. Are there any APIs that support partial or fuzzy matching instead?

 

2 answers

0 votes
Oleksii Melnyk
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.
June 24, 2025

Only self-made script.

I have python script, but you can make Scriptrunner or something else

import requests

# ==== CONFIGURATION ====
JIRA_URL = "https://your-jira-server.com"
USERNAME = "your-username"
API_TOKEN = "your-api-token-or-password" # For Server/DC you can also use your password
SEARCH_TERM = "test" # <- Enter the keyword to search for

# ==== AUTHENTICATION ====
auth = (USERNAME, API_TOKEN)
headers = {"Accept": "application/json"}

# ==== FETCH ALL PROJECTS WITH PAGINATION ====
def get_all_projects():
projects = []
start_at = 0
max_results = 50 # Page size
while True:
url = f"{JIRA_URL}/rest/api/2/project/search?startAt={start_at}&maxResults={max_results}"
response = requests.get(url, headers=headers, auth=auth)
response.raise_for_status()
data = response.json()
projects.extend(data.get("values", []))
if data.get("isLast", True):
break
start_at += max_results
return projects

# ==== PERFORM FUZZY (PARTIAL) SEARCH ====
def fuzzy_search_projects(projects, query):
query_lower = query.lower()
return [
p for p in projects
if query_lower in p["key"].lower() or query_lower in p["name"].lower()
]

# ==== MAIN EXECUTION ====
if __name__ == "__main__":
all_projects = get_all_projects()
matched = fuzzy_search_projects(all_projects, SEARCH_TERM)

print(f"Found {len(matched)} project(s) matching '{SEARCH_TERM}':")
for project in matched:
print(f"- {project['key']}: {project['name']}")

 

0 votes
Evgenii
Community Champion
June 24, 2025

Hi, @RUI HAN 

The REST API doesn't have built-in functionality for this, and there are no known hidden methods to achieve it directly. However, you can use a workaround: retrieve all projects via the API and then search through the resulting list to find the ones you need.

Suggest an answer

Log in or Sign up to answer