Forums

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

How to search for issues where custom field matches using the API

Benjamin Roswall
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!
October 22, 2022

I'm using the Jira API in C#

I know the following doesn't work, but I need to know how to make it work.

I need to search for issues, where a custom field matches the query. Preferably with a "Contains", but if it's only possible with an exact match, that's also ok.

Any idea?

 

Example of what I've tried.

var issues = from n in jiraConn.Issues.Queryable

             where n.Project == "DBSQA"

             && n.Type == "Hotfix"

             && n.CustomFields["customfield_12001"].Values[0].Contains("-323-")

             select n;

1 answer

1 accepted

1 vote
Answer accepted
Benjamin Roswall
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!
October 23, 2022

I figured out that there's an option to use "real" JQL, and in turn that custom fields in JQL use their "display name"... so it's a lot easier like that :-)

Task<IPagedQueryResult<Issue>> task = jiraConn.Issues.GetIssuesFromJqlAsync("Project = DBSQA AND Type = Hotfix AND \"First Included in CP\" ~ \"*-323-*\"");
task.Wait();
IEnumerable<Issue> issues = task.Result;

Suggest an answer

Log in or Sign up to answer