How to filter subtasks in JQL query

kranthi kumar g j May 6, 2024

I am trying to filter Subtasks in for statement like below, its not working.

not sure what am I doing wrong, Please suggest.

#{for s=Links[n].SubtasksCount|filter=%{(!'${Links[n].subtasks[s].Status}'.equals('CANCELLED'))}}

Key:${Links[n].Subtasks[s].Key}

summary:${Links[n].Subtasks[s].Summary}

#{end}

2 answers

0 votes
kranthi kumar g j May 6, 2024

Anyways. I figured it out what's the issue is.

in the filter statement I was using subtasks[s].Status s should start with upper case Subtasks[s].Status

 

this one worked:

#{for s=Links[n].SubtasksCount|filter=%{(!'${Links[n].Subtasks[s].Status}'.equals('CANCELLED'))}}

Key:${Links[n].Subtasks[s].Key}

status:${Links[n].Subtasks[s].Status

#{end}

 

Thank you for your help!

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2024

Hi @kranthi kumar g j -- Welcome to the Atlassian Community!

First thing, I am using Jira Cloud and not Data Center, and so cannot test my suggestion.

I believe the default attribute for Status is the id and not the name.  Perhaps try adding .name after the status field to compare to "CANCELLED".  Also, please confirm the case of the status name matches your comparison value.

Kind regards,
Bill

kranthi kumar g j May 6, 2024

Thanks Bill for your inputs!

I tried adding .name after status, no luck. it did not filter

how ever i see that status is working  if i just tried to print. please see below

#{for s=Links[n].SubtasksCount|filter=%{(!'${Links[n].subtasks[s].Status}'.equals('CANCELLED'))}}

Key:${Links[n].Subtasks[s].Key}

status:${Links[n].Subtasks[s].Status

#{end}

 

in the above code,i see that status is being printed.

also, I can confirm that Status name matches the comparison value.

 

I am new to JIRA , can you tell me how can i confirm if iam using Jira cloud or datacenter.

image.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2024

That version information indicates you are not on Jira Cloud; I do not believe there is any UI in Jira Cloud showing version information (except for the addons / apps).

Here is the list of Server / Data Center release notes: https://confluence.atlassian.com/jirasoftware/jira-software-release-notes-776821069.html

 

Again, I am not using Data Center and so the attribute information appears to be different.  Perhaps wait for other community members to respond, or also search in the developer community area: https://community.developer.atlassian.com/

Suggest an answer

Log in or Sign up to answer