Forums

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

Problem using date field in call to REST service

Olaf Braxhoofden November 5, 2018

We recently upgraded to Jira v7.11.2 and a custom solution built in VBA (Excel) to call the JIRA REST service stopped working.  As soon as I use a date field in the JQL statement the GET statement returns a status 400.

It does not matter which date field I use in the JQL, double or single quotes, a fixed date (any format, any separator) or a relative date (e.g. startOfMonth(-1) , endOfMonth(-1), I always get status code 400.

The same JQL statement works fine when copied into the JIRA front end.

As soon as I remove the date field from the JQL selection and only leave things like project, type etc, it works fine.

 

Any ideas?

Please please

2 answers

1 accepted

0 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2018

Hello,

Try to do it in the Rest Api Browser. Have a look if you have a error or not.

You can download the Rest Api Browser from here:

https://marketplace.atlassian.com/apps/1211542/atlassian-rest-api-browser?hosting=server&tab=overview

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2018

Your JQL parameter should look like this:

jql=project%20%3D%20XXX%20and%20cf%5B12090%5D%20%3D%20'Production%20(P)'%20and%20type%20%3D%20incident%20and%20priority%20!%3D%20Nieuw%20and%20created%20%3E%3D%20startOfMonth(-1)

Olaf Braxhoofden November 5, 2018

IT WORKS!!!!!!!

 

Thank you so much. You have no idea how much you have helped me.  I  have added a URL encode routine!

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2018

@Olaf Braxhoofden You are welcome!

If my answer helped you, kindly accept my answer :)

1 vote
Olaf Braxhoofden November 5, 2018

Hi Alexey, thanks for taking the time to respond. Unfortunately I am not an administrator in JIRA so I cannot install the utility.

 

It is a really strange situation.

JQL statement: project = XXX and cf[12090] = 'Production (P)' and type = incident and priority != Nieuw

works

JQL statement: project = XXX and cf[12090] = 'Production (P)' and type = incident and priority != Nieuw and created >= startOfMonth(-1)

Does not work. I get status code 400 but statustext = empty

 

Before the JIRA upgrade it worked just fine and on the command line in the front end it works fine. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events