Forums

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

Rest Api Query shows other hits than RunJira Search

Timm Flagmeyer October 23, 2018

Hi together,

 

hope someone can help me. For privacy reasons, I censor hostnames and main URLs.

 

I'm currently coding a script and i need a simple runjira query:

Search all open tickets for hostname XYZ* in four fields and only status open (not closed).

 

First, I built a query in the RunJira search bar:

 

Here is my link:

https://RUNJIRAURL.com/issues/?jql=summary%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed%20OR%20description%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed%20OR%20Identifier%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed%20OR%20comment%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed

 

And for better illustrate my query in the search bar:

summary ~ "XYZ1*" AND status != Closed OR description ~ "XYZ1*" AND status != Closed OR Identifier ~ "XYZ1*" AND status != Closed OR comment ~ "XYZ1*" AND status != Closed

 

It Works fine ! For the hostname XYZ1 I find two open tickets, fits perfect!

 

Now i can do the same search via Api:

 

My Api URL:

https://RUNJIRAURL.com/rest/api/2/search?jql=summary%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed%20OR%20description%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed%20OR%20Identifier%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed%20OR%20comment%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed

 

My curl in script:

#!/bin/bash

curl -X GET "https://RUNJIRAURL.com/rest/api/2/search?jql=summary%20~%20%22$HOST*%22%20AND%20status%20!%3D%20Closed%20OR%20description%20~%20%22$HOST*%22%20AND%20status%20!%3D%20Closed%20OR%20Identifier%20~%20%22$HOST*%22%20AND%20status%20!%3D%20Closed%20OR%20comment%20~%20%22$HOST*%22%20AND%20status%20!%3D%20Closed" --cookie "JSESSIONID=$SESSIONID"

 

Its the same Query like the Runjira search bar except from the main url, but now i find seven tickets, two open and five closed... but why? its the same query i dont get it.

 

Any ideas? 

 

Kind Regards,

Timm

1 answer

1 accepted

0 votes
Answer accepted
Timm Flagmeyer October 24, 2018

Okay I have a small update: I found out that if a open ticket is linked in a closed ticket, this will be still displayed via api.

 

Any Ideas how to fix that?

Timm Flagmeyer October 24, 2018

i also changed my query to:

 

text ~ "XYZ1*" AND status != Closed
https://RUNJIRAURL.com/rest/api/2/search?jql=text%20~%20%22XYZ1*%22%20AND%20status%20!%3D%20Closed
Timm Flagmeyer October 25, 2018

Have found another solution.

Suggest an answer

Log in or Sign up to answer