I have a custom field in my Epic type where I need to display information based on a variable within 'Component'. Is there a way this can be written for a JQL filter?
Example of this is:
If (Project = Optimus and Component = HR AND status != "3. Completed" ORDER BY status ASC), (Project = Optimus and Component = CXP AND status != "3. Completed" ORDER BY status ASC)
Is this possible?
No. JQL is not SQL, it's a simple search for a list of issues that match the criteria in it.
You can achieve this by providing calculated data to search on if you put a bit of effort into it. You've got two searches in your query, and it's not clear what the "if" is supposed to be doing (where's the "then/else" part?), so I can't quite work out what you're looking for.
As an aside, there's no chance of your "order by" working - a result set can only have one order
Thank you. Sorry to confuse.
If Component = HR display issues where the status is not equal to completed and order by ASC
Component = CXP display issues where the status is not equal to completed and order by ASC
I hope this helps to clarify what I want to do. The reason this has come up is I have installed the add-on Issue Matrix where it adds a visualisation based on a JQL Filter or Custom JQL mode
Ah, ok, well, you can get close to that without coding.
I am assuming the "else" is subordinate in this, and it needs spelling out because any issue could fall into one of four classes:
I think you want to try:
Project = Optimus and status != Completed and (Component = HR or (Component != HR and Component = CXP) )
Your "order by" is still not making sense though - you're not ordering by anything at all, and even if you were, it's one search, with one order, not two.
OK i see you point about ordering (obvious I am new to this)
Component = HR only display issues where the status is not equal to completed and order by status
Component = CXP only display issues where the status is not equal to completed and order by "CXP type"
The intended result will be that when I open the EPIC with component = HR it will only display tasks created with the component = HR and then order it by the status field
where as if I open the EPIC with component = CXP it will only display tasks created with the component = CXP and then order it by the "CXP Type" field
The addon issue matrix displays configured columns (picture attached to demonstrate this). you can see by this at the moment that it displays all tasks with the status of Planning. Not just the ones for component HR. Yes there are more than just HR and CXP. I figured once I get the basics down I can add the extra as necessary
This is not going to work - you've built up an over-complicated requirement that can't be done without a lot of extra work.
A JQL query returns a list of issues that match a set of search criteria. The criteria are applied to each issue independently of the others. It gives you a simple list of issues that match.
There is no "if".
There is a single sort order for the results.
The only way you're going to get your "if" in is with some code that calculates data that enables you to select on compounded parameters. I think you can also make that do the sort order, but it's going to be even more complex.
Hey there Community! Atlassian Open is kicking off in less than a month and we can't wait to touch down in Vienna, Sydney and Boston. This is an opportunity to create the future of teamwork with ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events