Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

jira api: how to search issues for strings in project

Hello I am trying to search for a strings within my project using the REST api but can't really understand the doc... For example I want to search for issues in the project CO and the summary must contain *test ssl*. Im expecting some payload that shows last updated etc..

1 answer

0 votes
Daniel Ebers Community Leader Mar 31, 2020

Hi Dennis,
welcome to Atlassian Community.

You are on the right track.

Which section of the documentation is unclear to you?
Based on this example section you will have to adjust the jql= part to query for what you are searching (for example the summary).

The response then should be similar to the one in the example section.

Cheers,
Daniel

So looking at the example :

 

curl \ -D- \ -u admin:admin \ -X POST \ -H "Content-Type: application/json" \ --data '{"jql":"project = QA","startAt":0,"maxResults":2,"fields":["summary","key"]}' \ "http://localhost:8080/rest/api/2/search"

 

But let's say I wanted to search for the string "test ssl" in the  summary how would I do it?

Daniel Ebers Community Leader Mar 31, 2020

It should be not more complicated like this:

POST: /rest/api/2/search

body: 

{

jql: "project = TEST And summary = example",

maxResults: 1000,

startAt:1000

}

Cheers,
Daniel

Hi @Daniel Ebers

I'm having issues with this as well.

I'm trying to post a jql query. This works --data line is important here:

curl -D- \   
-u PERSONAL_DATA_REMOVED \
   
-X POST \
   
-H 
"Content-Type: application/json" \  
 --data '{"jql":"summary~\"Testing\"","startAt":0,"maxResults":50,"fields":["id","key"]}' \ 
"https://localhost:8080/rest/api/2/search"

But when I replace the data with this it does not (it returns no results. I know for a fact there is an issue containing it:

  --data '{"jql":"summary~\"Testing mail for user: mail@domain.com 2021-07-05\"","startAt":0,"maxResults":50,"fields":["id","key"]}' \  

Could you please advise?
Thanks very much.

Jan-Willem.

Daniel Ebers Community Leader Jul 11, 2021

Hi @Jan-Willem Aikens

this looks good! I cannot spot any obvious mistake. Moreover I tested it with this Summary on my instance but it gave me back this very one issue - so I cannot figure out why it should not be working for you.
Is the user you are authentication with having permissions on this issue?
Can you open it through Jira itself (user interface) instead of API?

Regards,
Daniel

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you