How to proper write complex JQL-query for the REST-api (double qoute problem for custom fields) Edited

I am having a hard time preparing the following JQL using the REST api (JIRA 7.x)

project = KLPORDERS AND "Desired date - Prod" >= startOfDay() AND "Desired date - Prod" <= startOfDay("+24h") ORDER BY cf[11563] ASC

First problem when preparing the query string for the rest post request as documented in the JIRA REST API examples was that we are running on Windows. Having single quotes around the parameter value of --data caused the error ["Unexpected character (''' (code 39)): expected a valid value As the link shows, solution is to use double quotes, and then use tripple double qoutes to escape them "inside" of the --data value. But I will still run into problems due to the need of having qoutes around the custom fields and the parameter used to specify start of day pluss 24 hours

startOfDay("+24h")

If only the custom fields I could have asked how to get hold of the internal key of the custom field, ref.

ORDER BY cf[11563] ASC

But - that won't sort ou the "+24h"....

Further more, we need to trigger the REST call using a .bat-file, so therefore trying to use POST instead of GET, since GET requires URL encoding, and that is even harder to solve due to .bat-files not enjoying the escape charaters.

Any suggestions on how I could solve this problem?

1 answer

0 vote

Hi Rune! This looks like a developer question, so my recommnedation would be to submit it to our Developer Community, you can find it at community.developer.atlassian.com.

Hope this helps :)

Ana

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jun 14, 2018 in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

491 views 2 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you