Hi,
Is there a way to extract sub issues along with the parent issue while using a JQL with the parent filter field?
Example: https:base/rest/api/3/search?jql=project=TEST+and+cf[10814]~'user@test.com'
Note:
cf[10814] = parent field
Currently, I'm able to extract only parent issues and I'm missing sub issues.
Hi,
Sadly you cannot achieve the desired search using standard features on Jira, you must go for a third-party app instead. Using i.e. JQL Booster Pack (if you are on Server / DataCenter) you can type the following:
1) A bunch of issues
project = PL AND issuetype = Task AND fixVersion = "v1.2"
2) Find all subtasks under a given issues
issue IN subtasksOf(' project = PL AND issuetype = Task AND fixVersion = "v1.2" ')
(*) Note that this is just an example, you must tune above query to fit your needs.
Using this app you can also query other issues relations, check:
Regards
Hi @akukkuje
What kind of parent field is it? If I'm reading the above right, Parents are usually not email addresses!
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ste Wright
It's a custom field and using this custom field to store some email address and I'm trying to filter issues based on the value in the custom field.
Please note: The above custom field is not present in sub issues.
currently, I'm able to get only the list of parents but not their sub issues in the final response.
I'm trying something like: key in subtasksOf(jql)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @akukkuje
Just to confirm, you want to see:
You mention subtasksOf - this kind of JQL function is only available via an app, allowing you to include a sub-query.
Apps such as ScriptRunner allow you to have:
issueFunction in subtasksOf("project = TEST AND cf[10814] ~ 'user@test.com'") or project = TEST AND cf[10814] ~ "user@test.com"
^ This gives you the sub-tasks below the parent issues, and the parents themselves
This is the actual JQL, which you could for the REST API call.
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ste Wright thanks for your suggestion.
I found "key in subtasksOf(jql)" while searching on google.
Can we do the above task using cloud REST API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @akukkuje
Potentially - you'd be best to attempt this on your instance as you have the custom field.
I'm not as strong with the REST API, but something like this after "jql=" might work:
issueFunction%20in%20subtasksOf("project%20%3D%20TEST%20AND%20cf%5B10814%5D%20~%20%27user%40test.com%27")%20or%20project%20%3D%20TEST%20AND%20cf%5B10814%5D%20~%20"user%40test.com"
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm getting the below error:
"Field 'issueFunction' does not exist"
URL: https://base/rest/api/3/search?jql=issueFunction%20in%20subtasksOf("project%20%3D%20TEST%20AND%20cf%5B10814%5D%20~%20%27user%40test.com%27")%20or%20project%20%3D%20TEST%20AND%20cf%5B10814%5D%20~%20"user%40test.com"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @akukkuje
Do you have the app I mentioned? If not, this function won't work.
You'd need an app which extends the ability of JQL, like ScriptRunner - or you can search for an alternative app on the Marketplace
If you choose an alternative app, ensure it has the function you're looking for, and it might modify the JQL slightly as not all apps use the same phrases :)
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, okay. Currently, I don't have the above app.
I'm trying with postman and using just a REST call.
Is there any alternative REST call or format?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @akukkuje
Not that I know of I'm afraid - but another member of the community might have their own idea :)
Ste
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.
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.