Hi Team,
I have REST URL as below using in ServiceNow doing "get" it is working fine, but I also want to get the records that are updated in last 1hr.
Please suggest how can I do that
https://jira.abc.com:443/rest/api/2/search?jql=project=REC&maxResults=100&key
Regards,
K
Hi Ashok,
Have you tried the 'updated' property?
project = REC and updated > -1h
Note - this will also show you issues where comments or work logs were added, it does not track just field or status values.
//R
Hi Radek,
I tried like this as your mentioned above, still not able to retrieve records
getting an error invalid query
https://jira.abc.com/rest/api/2/search?jql=project =REC and updated >-1h
Please let me know if I'm doing anything wrong here
Regards,
Ashok
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashok,
I'm guessing your query is not valid due to a problem something like a shell expansion (because '>' is a control character in shell) OR you are not authenticating in the request and so it cannot find the project.
Works fine for me without html char encryption if I paste the query in browser, so it makes me think that likely it's stemming from your client that you're sending the request from.
Do you have an option to wrap the URL parameter? Or you could try the POST format and provide the jql query as body.
Just to clarify what I mean is that if I use the raw jql, it will work OK in the browser, but if I were to send this with cURL, and the URL is not wrapped in single quotes '', then it will fail and try to redirect the output to a file "-1h". Something like this I think.
Regards,
Radek
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.