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,298,377
Community Members
 
Community Events
165
Community Groups

HOw to search for issue where custom field contains part of a string ?

Dear all,

I have a custom field which is a list box field of text.

When user create a ticket he select from that list box the proper item

What I need to do from an Automation rul is to check as a condition that :

IF my_CustomField contains "ABC", then I should do an Action

Typically, all the follwing value of my field should return true :

my_CustomField = 123-ABC9993383

my_CustomField = ABC9993383 

my_CustomField = 9993383ABC

 

What is the proper syntax to build that rule JQL condition ?

I have tried the following :

my_CustomField ~"*ABC* which should cover all case

But when I test this in search issue query, I have an error saying that "*" are not supported.

 

What is the proper way to do this search ?

regards

2 answers

Hi @Calderara Serge 

As you're on Jira Cloud, the correct answer is to get an app that provides JQL extensions you're looking for.


With standard JQL, you can only get a list of issues and export them to Excel for further processing. This works if you want to do a one-off analysis. If your use case is more dynamic than that, look beyond standard Jira.

Standard JQL doesn't easily allow it, but you can quickly find the results using our professional indexing service JQL Search Extensions

 

You can use this query to filter your issues where a custom field contains part of a string

 

issue in wildcardMatch("my_CustomField", "ABC*")

 

The star symbol can be placed anywhere in the text – you can even place more than one.

 

Check out the documentation for more examples.
I hope this helps!
Maurício

0 votes

You can't do this search.

The whole point of a select list is that you have a fixed range of items with clear, uniquely identifiable options.  There's no need to be able to search for part of the name of an option in these fields.  The desire to do so indicates that you've not defined your usage of the field properly.

There is a fix:  

Review your use of the field.  Is it really a select-list?  Your desire to do partial searches suggest that it should probably be a text box, or maybe a combination of fields (for example, a select list for ABC and a text box for the rest of the string, or a cascading select, or a sleect and a numeric field)

There is a kludge:

Create an automation that runs when the field is changed.  Create a text field (not put on the edit screens).  The automation can copy the name of the option selected into the text field.  Then you can use ~ to search the text field.

@Nic Brough _Adaptavist_ , thanks for your reply

This is the way my customer is working base on its product Type name and I cannot change their identification

In fact when they have selected the product name in the list for exemple :

123ABCD45678, in fact out of this name, the caracters at position 2,3,4 is the product type group

From an automation IF I need to check this product type ID out of this string in order to populate an other field with the type

For exemple I have define a IF condition in Automation as below

yBD86ZL80f.png

From my rule above, that means if my field contains in 2,3,4 position the string M22, then I will edit an other field in the form and set it to HB2

This works fine for one condition but what I need to to check different value as below

IF {{issue."Charging Station SN".substring(1,4).capitalize()}} EQUAL M22
OR {{issue."Charging Station SN".substring(1,4).capitalize()}} EQUAL M23

THEN myType = HB2

I could not find a proper condition which allows be to implement this in Automation

Any idea ?

It's the same answer I already gave, either sort out the product identification into sane fields (either split into more fields to avoid the customers silly naming scheme, or turned into a text field because that's how you want to use it).

@Mauricio Groth - __JQL Search Extensions also gives you a solution without having to set your fields up properly.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Events near you