Entering a url, or running with curl, like:
https://<myurl>/rest/api/2/search?jql=project=<myproject>&status=closed&fields=id,key,status,project&maxResults=5
returns me 5 items in my project but with all statuses. For some reason I can't query for a specific status.
The output (part of it) is:
{ "expand": "schema,names", "startAt": 0, "maxResults": 5, "total": 727, "issues": [ { "expand": "editmeta,renderedFields,transitions,changelog,operations", "id": "79577", "self": "https://<myurl>/rest/api/2/issue/79577", "key": "<myproject>-774", "fields": { "project": { "self": "https://<myurl>/rest/api/2/project/<myproject>", "id": "14421", "key": "<myproject>", "name": "<myproject>", "avatarUrls": { (...) } }, "status": { "self": "<myurl>/rest/api/2/status/1", "description": "The issue is open and ready for the assignee to start work on it.", "iconUrl": "https://<myurl>/images/icons/statuses/open.png", "name": "Open", "id": "1" } } },(...) ] }
How to query for a given status? Many thanks.
Your parentheses need to be properly encoded:
( = %28
) = %29
An easy way to get the proper encoding is to
5,5 years later but still... Great tip!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
7 years 8 months later and still a great tip, thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
YES! Finally got it working, thank you!!
$url = 'https://<oururl>.jira.com/rest/api/2/search?jql=project%20%3D%20<ourteam>%20AND%20status%20in%20(%22In%20Analysis%22%2C%20%22In%20Development%22)%20ORDER%20BY%20priority%20DESC%2C%20status%20DESC&fields%3Did,key,summary,priority,status,project,assignee';
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, this helped a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JQL for statuses:
status in (resolved)
In your example
https://<myurl>/rest/api/2/search?jql=project IN (<myproject>) AND status in (resolved)&fields=id,key,status,project&maxResults=5
Please, don't use "=" in URLs variables. Change them to %3D or use "IN". You can use URLencode to get rid of them.
https://<myurl>/rest/api/2/search?jql=project%3D<myproject>%20AND%20status%3Dresolved&fields=id,key,status,project&maxResults=5
When you search for issue in JIRA's Issue Browser, you can click "Advanced" link, to show current query as JQL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Proszę bardzo :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tomasz Rykala , is the 'jira.com' bit necessary?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still doesn't help. My items are always sorted by ID descending.
Current query:
$url = 'https://<oursite>.jira.com/rest/api/2/search?jql=project%3D' . $TEAM . '%20AND%20status%20IN%20(%22in%20analysis%22,%22in%20development%22)&fields%3Did,key,summary,priority,status,project,assignee%20ORDER%20BY%20priority,status%20asc'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you ever get this working? I'm having trouble getting the orderBy setting to work properly...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John D_ Lewis The "current query" example in the question you are asking about has field parameters in the middle of the JQL parameter, so it isn't going to work regardless of how you set up the order by clause in the JQL. Do you have an example you are working with that you want to post?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to get this query to work (from a nodejs app): "https://" + user + ":" + token + "@site-name-here.atlassian.net/rest/api/latest/search?jql=project='project-name-here' ORDER BY 'key'&maxResults=100" - took me a while to get the single-quotes and spaces working properly, but now it's ironed out (and looks so simple!)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, could you help me with this please? I can't get my results to sort.
...&fields=id,key,summary,priority,status,project,assignee%20order%20by%20priority%20asc
doesn't sort my results by priosity in ascending order for example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.