Hello,
I am trying to search the Jira Service Management API for all issues with the word "Email" in the summary. Following the documentation has not given me the result I am looking for.
The searchTerm parameter doesn't appear to be working as expected. It states "Filters customer requests where the request summary matches the searchTerm. Wildcards can be used in the searchTerm parameter." However, when I put "searchTerm=Email" in the api call, it returns 3 issues, none of which have email in the summary.
Please can someone help here.
Thanks
Hi @Toby Hunter
Set the term as searchTerm="Email"
Or use the cloud platform api to search issues
/rest/api/latest/search/jq?jql=project = <project ket of jsm project> and summary ~ "Email"
Hey Marc,
That doesn't work either. I don't know if I am doing the wrong thing but it just doesn't like it.
https://api.atlassian.com/ex/jira/{id}/rest/servicedeskapi/request?searchTerm="Email"
That's my call which returns no issues yet a simple search in JSM shows several issues.
It is worth pointing out that I had the cloud platform API search set up originally but ran in to an issue when I added scopes to the token. If I use a token with no scopes, it works fine. If I use a token with the correct scopes as listed on the documentation, it returns an authentication failed 200 message.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Toby Hunter
If you use a scoped token, these scopes are needed:
All options under the granular option are needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Marc,
Those are the scopes the token has but it still fails every time.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Toby Hunter
When using which call, via the JSM API or Platform API.
What are the calls you are making?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Marc,
So here are the two search calls I have and their listed problems.
Platform API: Call correctly returns the issues but when a scoped token is used with the scopes listed on the documentation, the call returns a 200 but with an authentication_failed header.
https://{domain}.atlassian.net/rest/api/3/search/jql?jql=project = "{p}" AND summary ~ "\"Email\"" ORDER BY id ASC&fields=summary
JSM API: Call works with a scoped token or not but does not return the issues it should. Either returns no issues or issues without email in the summary.
https://api.atlassian.com/ex/jira/{project}/rest/servicedeskapi/request?searchTerm="Email"
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Toby Hunter
What is the result if you do this JQL in Jira itself.
Is the scoped token based on your account or a service account?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Marc,
The JQL works fine and returns the expected issues.
The scoped token has been tried from both my account and a service account to my knowledge, but I'll check that.
Thanks
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.
Hi @Toby Hunter
So if you use the platform API and the JQL, do you get the correct results?
Be aware that the JSM API only gets requests made by customer via the portal, not all issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Marc -Devoteam-,
Using the platform API, yes I get the correct data. However, I then run into my scoped token problem, which I have read is because scoped tokens do not exist yet in the platform API. Is that correct?
Regarding the JSM API, I did not know that. It would explain why most issues are missing, as they are raised via email and not the portal.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Toby Hunter
No the platform API allows scoped tokens.
Scoped options, using search:
Granular: read:issue-details:jira, read:audit-log:jira, read:avatar:jira, read:field-configuration:jira, read:issue-meta:jira
There is a difference, you can have a scoped token based on your user, you the URL: https://<your-instance>atlassian.net/rest/api/...
If you use a service account, use the URL: https://api.atlassian.com/...
Also make sure when using a service account, that this account has the correct permissions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Marc -Devoteam- ,
That has resolved my issue. Thank you so much. I didn't know that the URL had to be different for service accounts.
I'll share that knowledge around the teams.
Thanks again. Have a fantastic week.
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.