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

Rest Api Query shows other hits than RunJira Search Edited

Timm Flagmeyer Oct 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 Oct 24, 2018 • edited

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 Oct 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 Oct 25, 2018 • edited

Have found another solution.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

1,766 views 3 15
Read article

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