Here is a scenario. I am using colors and objects to explain.
My Stories require that a user adds two Components: Blue, Shirt.
However, my users sometimes forget to put color or object. I have an automation rule setup on the backend to catch what new ticket has been created with both components. However, if it's missing one of them, the rule does not run.
I need help creating a JQL query that can tell me which Story has only 1 component.
In my organization, I cannot have a new field with the values (these values change). I must use the component/s field.
I am not a programmer or know the code. I just need a JQL code to be able to catch a ticket with only 1 component listed on Stories only.
There is no way to do this directly, JQL is for finding issues, not processing the data on them. You could search for issues with Blue, or Shirt, or both at the same time, but you can't search for issues which have an arbitrary set depending on other bits of the set.
However, you could get a little bit clever with some reporting.
I would set up a new dashboard, and add three gadgets to it. You could easily use it to find issues that are not right.
Gadgets 1 and 2 immediately show you where you have "broken" issues. If you actually have multiple combinations, you might want to adjust them to be more like "components in (Red, Black, Blue) and components not in (Shirt, Jeans)
Gadget 3 might not be that useful, but it might be quicker, especially if you have more than just Blue and Shirt to work with.
Hi @Diana Leon -- Welcome to the Atlassian Community!
You could check the number of components with the following in your rule:
You could use that in your issue created rule, or in another rule checking for changes to components.
With JQL, I believe with out-of-the box features you may only check for EMPTY or IS NOT EMPTY for components.
I tried it and it did not work.
Thanks for your rule image and additional information. I should have been more clear that I was suggesting to use a condition in the rule. For example:
Nic's answer with the dashboard gives you the overall status view of issues meeting/not meeting your component criteria. I was also suggesting the rule approach as you already noted using an automation rule.
Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...
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