Hello,
how can I use searchTerm filter in Jira Servicedesk?
This is the link of Jira API
https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/request-getMyCustomerRequests
Hi Jack,
The document you reference here is a Service Desk REST API guide. One way to make this kind of REST GET call, is to use a utility like curl. There are cited examples of how you can use this utility and pass it authentication, headers, etc, along with sometime a json payload in order to obtain the results of that request. More examples of doing this are in https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/
In this specific case, calling that REST endpoint has other parameters like searchTerm that get passed into the URL itself. So if you wanted to search your own requests for the term 'migrate' the URL you would call in your REST would look something like this
http://jira.example.com/rest/servicedeskapi/request?searchTerm=migrate
You would still need to handling authentication and the other headers, so if you were using curl do to this, your command might look more like this:
curl \ -D- \ -u fred:fred \ -X GET \ -H "Content-Type: application/json" \ http://jira.example.com/rest/servicedeskapi/request?searchTerm=migrate
Thanks for support!
How do you perform for issueKey? For instance my issueKey='Host1234ID', how do you add that to the searchTerm query parameter ?
Hi @Ian Russel Adem
The endpoint that the previous user mentioned was GET /rest/servicedeskapi/request however that specific endpoint doesn't let you search by issuekey. The searchTerm parameter in that endpoint specifically says it is only looking at the Summary field.
searchTerm string Filters results to customer requests where the issue summary matches the searchTerm. You can use wildcards in the searchTerm.
searchTerm
Filters results to customer requests where the issue summary matches the searchTerm. You can use wildcards in the searchTerm.
So I don't expect that the searchTerm parameter here to be able to use issuekey when searching because the issuekey is not part of the request/issue summary.
If you already know what the Issuekey is, then you can instead try using the GET /rest/servicedeskapi/request/{issueIdOrKey} endpoint. But if you are specifically looking for a way to search for requests in the Jira Service Desk REST API by issue key, I don't think it's possible. Licensed Jira users might be able to use JQL search as described in GET /rest/api/3/search. JQL can let you make that kind of search. But unlicensed users that are only in Jira Service Desk's customer role won't be able to make a call like this. Their account simply lacks the privileges to make this kind of search.
It looks like you're new here. Sign in or register to get started.