I am trying to search for issues using values within a custom field that is a JSON object. Here is an example:
"customfield_15000": {
"data": {
"text": "blabla",
},
"identifiers": {
"id": "18",
"name": "Main location",
"value": "Left of centre"
}
}
I want to search using REST API (/rest/api/3/search) for all issues that have value of customfield_15000.identifiers.id = 18 (in JSON-speak). I tried using cf[15000].identifiers.id = 18 but I'm getting an "Error in the JQL Query: Expecting operator but got '.identifiers.id'. etc" message.
Is this even possible using JQL/REST?
Thanks in advance for any suggestions!
Hi @dmatijasevic ,
I'm not an expert but JSON is a result of the search, not the search parameters.
Check if JQL recognizes this particular customfield_15000 and/or value/name/id. If it does, you can use it in the request sent to API.
If not, search for all issues (most accurate you can be, maybe use other filters) and in the code check if issue has the value you're looking for. I know it may be time consuming but I believe it would work.
Best,
Michael
Yes, you are right, this JSON is a result of the search. My question is probably not phrased correctly, I am looking for the JQL statement that would search for the value within a complex custom field. I'm afraid, I can't phrase it any better.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What do you mean by 'custom complex' field? What specific type of field is customField_15000? Is it a text field, drop-down list, radio buttons, user lookup etc?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, it seems to be a field that JIRA Service Desk uses internally to hold relationship between "classic" requests and SD requests, so the answer is I have no clue. Sadly, the "search" function in JIRA SD is awful so I am trying to find a way to use Core APIs to compensate.
In the meantime, I found another way to search for issues, so this question is no longer relevant in that regard.
Thanks to all who replied!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @dmatijasevic ,
could you share your new way of searching for issues? Maybe I can learn something too :)
Best,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not really a new way, I just found how requests are mapped between Jira and Jira SD (service desk becomes project) so using "classic" JQL proved enough.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.