Hello,
I'm trying to send a more complex JQL over rest api currently testing in postman and I cannot seem to get the end of it with formatting to keep the escape characters of the jql in place properly. Whenever I manage to fix the jquery to be valid, I get a jql error and the other way around as well.
Any chance anyone could help with this or did anyone find a way around stuff like this?
Thank you!
JSON (The point where I got it to and I don't know anymore thinsg to try with it):
{
"jql": "project = \"PROJECT\" AND issuefunction in parentsOf(\"issueFunction in subtasksOf(\\\"issuefunction in parentsOf('type in subTaskIssueTypes() and status != Resolved and component = ABC') and status = 'Status' and type = 'Issue Type'\\\")\") ORDER BY \"Start date\" DESC\"",
"startAt": 0,
"maxResults": 1,
"fields": [
"issuekey"
]
}
The exact jql that functions in jira and needs to be sent on the api:
project = "PROJECT" AND issuefunction in parentsOf("issueFunction in subtasksOf(\"issuefunction in parentsOf('type in subTaskIssueTypes() and status != Resolved and component = ABC') and status = 'Status' and type = 'Issue Type'\")") ORDER BY "Start date" DESC
Hey
I am not sure how you are sending this JQL. It's always easier to form the rest api url after executing the JQL.
My url after executing in JIRA:
https://myinstance.com/issues/?jql=project%20%3D%20META
My rest api URL would be:
https://myinstance.com/rest/api/2/search?jql=project%20%3D%20META
Let me know if this helped
Hey @jira guy ,
I'm trying to send that json with post to - https://jira.vidaxl.com/rest/api/2/search
What you're saying does help, but I'm trying to fetch only 1 result per call, only with the "issuekey".
If I'm making a GET request on the rest api url after executing the jql string, I get default max results 50.
Any idea on that one?
Also, thanks a lot, it did help me move forward one step at least.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use pagination. You can limit the results and loop through using startAt param. You can also end the search by comparing the total.
https://myinstance.com/rest/api/2/search?jql=project%20%3D%20META&maxResults=10&startAt=2
Check out the rest api documentation for more info
https://docs.atlassian.com/software/jira/docs/api/REST/8.2.4/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No idea why I didn't take into consideration including everything in the url, since I did look into the API documentation from the start. Thanks a lot for the help!
I also added "&fields=issuekey" and it returned exactly what I was struggling to achieve through POST. Better open my eyes more next time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It happens :)
Make sure to accept the answer that helped. So others in the community can benefit.
Edit: nevermind :p
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hehe, it's ok. Ofc I would accept the answer, I was just taking the ridiculously hard way and you just pointed the obvious which I overlooked.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.