Let's say I have a custom field cf[X]. That field contains another field (or object or whatever) called requestType which then contains another field serviceDeskId.
"customfield_X" : {
"requestType" : {
"serviceDeskId" = "777"
}
}
Is there a way to filter on the serviceDeskId using JQL? Something in the vein of
cf[X].requestType.serviceDeskId=777
?
Seems this was not possible in 2015 (only nested fields question I found) but I'm hoping the basic functionality was added - though I admit no luck in finding a solution.
Hi Brandon,
If I understand correctly, you are looking into the requesttype field of a json response and want to be able to filter issues in Jira based on the serviceDeskId value of that request type. This is not possible to do directly via JQL, either in the web UI nor in the REST API.
But that said, you could take that serviceDeskId value, and first call the endpoint of GET /rest/servicedeskapi/servicedesk/{serviceDeskId}. This endpoint will return to you the projectId in question, such as this example:
{
"id":"2",
"projectId":"10004",
"projectName":"AJSD",
"projectKey":"AJSD",
"_links":{
"self":"https://[myCloudSite].atlassian.net/rest/servicedeskapi/servicedesk/2"
}
You can then call the search endpoint and search by the projectId, projectName, or projectKey in order to find which issues in Jira are in that project in question.
Is this a helpful alternative? Or am I perhaps misunderstanding the endgoal here?
Let me know.
Andy
Hey Andy,
Thanks for the reply! That was just an example of something I was looking at when I wrote the question to illustrate the idea not necessarily a specific use case. So filtering on sub-fields is not possible directly from REST then? I assume if you can't then it's highly unlikely that you can request sub-fields specifically in a REST query (something like fields=cf[X].SUB_FIELD_A.SUB_FIELD_B) - or is that possible?
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The structure of the json payload you see from a REST call can show custom fields and their sub-values. But to perform a search in Jira, it relies upon JQL. JQL will index values for specific custom field, and in turn these can be searched for.
However the way you're describing this, I don't think you are going to be able search for issues in your way. Jira can have lots of different custom field types, some of these might show nested values such as dependent dropdown fields or cascading select field types.
These can be searched for via JQL. I also have a fear that the Request types field might have been a misleading example to start with, because that data is part of a system field for JSM, and technically not a user created custom field.
To see if I can better explain this, I created a dependent dropdown field in a team managed project, like so:
And then I assigned one issue a value1 of Goodbye, and value2 of forever. From that point, instead of trying to look for a search such as dropdown=Goodbye.forever as I think you are purposing, in JQL you can just use a query of
dropdown=forever
and it will return that issue in the results.
I understand this is in the web interface, but since JQL behaves in the same way in the web as the REST API, you can use this same kind of query to find the data I think you are looking for here in most custom field cases.
In turn you can then make a REST call to the search endpoint
GET /rest/api/3/search?jql=dropdown=forever
And that can return to you all the issue in Jira with that field value that your account has access to view/browse.
I hope that helps.
Andy
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.