Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,369,304
Community Members
 
Community Events
168
Community Groups

How to search if Component has more than one value in it?

Nari Man Rising Star Sep 10, 2019

We use Component as team value. SO a ticket assigned to component A belongs to Team A. Problem is sometimes people assign more than one component to a ticket and that ticket is basically not owned by anyone. 

I need to know if a ticket has more than one component value.

How do I query "component is ONLY value-x". Or component has only one value in it? 

 

thanks

6 answers

1 accepted

0 votes
Answer accepted
Ste Community Leader Sep 11, 2019

Hi @Nari Man

As far as I know, using Scriptrunner JQL won't give you this query either - it has more powerful component searches but would still required the "not in" addition to remove those with more than just one component.

Suggested approach is to create a custom scripted field for count of components - that way you can search for the required component in issues with a component count of only 1.

I found details on this thread about creating the scripted field - and see this Confluence page from the creator of ScriptRunner - there is a discussion on the issue in the comments section, right at the top :)

Ste

Nari Man Rising Star Sep 11, 2019

thank you. 

Like Dyonata Laitener Ramos likes this

I would like to know why is not better solution to create custom jql function instead of creating custom scripted field for count of components?

I think the work will be nearly the same and you do not need new field and the function can be possible to use for any multivalue field?

But would someone give her an example for script runner?

Since we don't have an easier, direct solution - what I tried instead is to take an export (csv) with the component field being in the search result. And then use excel do the work! When we export it puts individual components in separate columns, so its a lot easier to figure out how many have only 1 or 2 or more.. pretty useful when the results of the query is of large number.

0 votes
Nari Man Rising Star Sep 11, 2019

Thank you. I have 10 components. So I guess it is not undoable. 

I wish there was an easier way. 

0 votes

you can use following query 

 

component ="your required component"and component not in ("Add all those componenets which you want to exclude")

Jack Brickey Community Leader Sep 11, 2019

Yes that is what I conveyed above but that really isn’t scalable unless the components are few and new ones are rarely if ever added.

Like Thorben Röder likes this

That you this works fine for me without any addons!

0 votes
Jack Brickey Community Leader Sep 10, 2019

you will need an addon for this unfortunately. unless of course you wanted to hard code the query which is unwieldy in most cases.

example...

component = A and component not in (b,c,d,e,f,...)

component = B and componente not in (a,c,d,e,f....)

...

Nari Man Rising Star Sep 10, 2019

Which Add-on?

Jack Brickey Community Leader Sep 10, 2019

i would look at scriptrunner or power scripts there may be others.

Nari Man Rising Star Sep 10, 2019

We have scriptrunner. I am looking for specific help on what query will give me the results. 

Suggest an answer

Log in or Sign up to answer