I’m trying to get requests from my users using ServiceDesk REST API.
No matter if I set the requestStatus parameter as open, closed or both, I always got the same list. I examine the returned JSON and I got requests with statusCategory as “DONE”, “NEW” and “INDETERMINATE”. All when asking for open, none when asking for closed.
When I was doing this with JIRA REST API, and my user, I can use JQL to get a list of issues with a list of status like “Accepted”, “rejected” or “inDevelopment”.
Am I doing something wrong? Some missing configuration or a parameter in the request that I didn’t saw?
Is it safe to assume that you are referring to Get customer requests API? I’ve tried these two requests - one using CLOSED_REQUESTS and the other using OPEN_REQUESTS - and both yielded the expected responses.
In order to better understand your scenario, can you share the request you are sending?
Also, the same one with CLOSED_REQUESTS.
The first returns all of our requests, open and closed, that our client has access. The second returns no requests at all. I think it’s because we’re using custom “status” (“in development”, “testing”, “pending payment”…) and they’re not defined as “open” or “closed” (they should be, in Jira cloud looks like they are, but not on ServiceDesk, I don’t know, I’m not the administrator).
The best way would be to select requests based on their “status”, the same way we did in another project with Jira Cloud REST API, Search issues, using JQL: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-post
But JQL is out of reach on ServiceDesk API, and I don’t if it’s possible, at all.
Thanks, this clarifies the behavior you are experiencing.
For your use case, you can still use Jira Cloud’s Search for issues using JQL even if you are searching for service desk issues. There, you can use the custom status field in your JQL. If you want to search for all service desk issues/requests in a specific custom status you can try something like
custom_status in (“in development”, “testing”, “pending payment”) and projectType = service_desk
Is there a specific need for you to use a JSM Cloud API or does the information returned by Jira Cloud REST API’s issue search sufficient enough?
No, I can’t use Jira Cloud because we are making a website for our customers, that doesn’t have an Atlassian account, they’re just JSM customers.
I can’t connect them with Jira Cloud, I had to do via ServiceDesk, using Basic Auth (I wrote to support, and they told me that OAuth connection for JSM customers is in the scheudle, but there is no release date since 2016).
So, “Search for issues using JQL” in Jira Cloud REST API is not an option.
Stepping back a bit, when you said you are using custom status, can your administrator edit the status category in the workflow your JSM project is using (see image below)? There, they can map the status to the correct category and your call to Get customer requests endpoint should return the expected response.
Ok, my administrator is checking the status configuration that you provided. It looks like it wasn’t checked before. I’ll tell you when he finish with it.
About the second part, no I can’t use Jira Cloud API. I told you, our costumers don’t have an Atlassian account, just a customer account that you can create inside Jira config. They can’t connect with Jira because an error says that they don’t have a Jira database, they only can connect to ServiceDesk.
I was asking to support for two weeks about how to connect them with Jira Cloud, using OAuth2 and Basic Auth, and I have to re-write all the Jira section of my project in order to connect and use ServiceDesktop, because there is NO WAY to do it right now.
EDIT: my administrator said that the Category configuration of status are configured, but still the same issue with filter.