Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

RAG Status Coding

Keith Shipman August 14, 2025

Hi everyone I'm after a bit of help if possible.

I'm trying to write a code using JQL to find any Story issue types that have a green "RAG Status" but a Sub-task on the Story has a red "RAG Status"

It feels like it should be a fairly simple one but I just can't seem to get the coding right

2 answers

4 votes
Nikola Perisic
Community Champion
August 14, 2025

Hello @Keith Shipman 

Could you elaborate more about these green and red statuses? In Jira, statuses can be grey (To Do), blue (In progress), green (Done). Is the RAG-Status a label instead?

Keith Shipman August 14, 2025

Hi Nikola thanks for replying.

The RAG status' we use are in the "Details" side of the card and are a drop down option when you click into it.

This is what it looks like if that helps:

Untitled.png
For us Green is on track, Amber is slightly off track and Red would be seriously off track and causing a considerable risk. We'd also use Blue for Completed/Delivered

Nikola Perisic
Community Champion
August 14, 2025

So this is actually a drop down custom field and you want to have these options to be colored. I'd recommend Awesome Custom Fields app from Atlassian marketplace. Jira doesn't have the functionality to add the colored dropdown custom fields.

Keith Shipman August 14, 2025

Ah sorry Nikola I'm not sure if I managed to explain it correctly.

The colours are fine, I'm looking for some help with the coding to identify any Story issue types that have a Green RAG status on the card but a linked Sub Task has a Red RAG status

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
October 15, 2025

Hi @Keith Shipman

unfortunately, this is trickier than one might think; as a "hierarchical query", it would really require some kind of join or subquery, which isn't available in plain Jira/JQL.

A few directions forward:

  • If it's a one-off thing, you could first query the relevant parents, and then use the keys of these parents in a second query, in an "parent in (KEY-1, KEY-2, ...)" clause.

If you want to run your search dynamically, without manually stitching two queries together, you'll need extra tooling:

  • You might be able to use Jira Automation to "propagate" parent information down to the parent's children, and then use the respective field(s) on the children to include them into your filter. Obviously, this will add a fair bit of complexity to your system.
  • There's different apps from the Atlassian Marketplace that can help with that. First, there's a number of apps that extend JQL by additional functions, including hierarchy-related functions. I've used JQL Search Extensions a few times and it works well.
  • Alternatively, you could try one of the more hierarchy-focused apps from the Marketplace. These apps typically have their own ways of figuring out parent/child relationships between issues, and provide more powerful ways of searching through issue hierarchies. I myself work on such an app, in which your use case would be easy to solve - I'll provide more details below.

Hope this helps,

Best,

Hannes

Hannes Obweger - JXL for Jira
Atlassian Partner
October 15, 2025

... and just to expand on my last point, this is how this could look in the app that my team and I are working on: JXL for Jira.

Put simply, you'd create a sheet with all issues that are potentially relevant to you, enable the default issue hierarchy (that's just one click), and then use JXL's filtering capabilities to narrow down to the issues that you care about:

rag-status.gif

Once you have your list of issues, you can work on these directly in JXL (much like you'd do in e.g. Excel or Google Sheets), trigger various operations in Jira, or export them for further processing.

Any questions just let me know!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events