Forums

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

Automation, lookup issues, and match function

Florian Beqiri November 20, 2025

Hello everyone,

I'm having a problem with one of my automations. I have vulnerability tickets that contain a paragraph field with different host names.

Now I want to go through this field with host names in an automation and count how many hosts that match a regex are contained in total.

But it just doesn't work. I think it's because of my wrong approach. 

 

have vulnerability tickets that contain a paragraph (multi-line) text field listing multiple hostnames, for example:


example-ce003.example.local, example-ce004.example.local, example-cf104.example.local, example-cf116.example.local

My goal is:

Go through this paragraph field in the automation and count how many hostnames match a certain regex pattern, such as:

 

example-cf*.example.local
The soltuion should be: 2
Unfortunately, match() hasn't worked so far.

Ultimately, I want to store the number of my results in a variable. For example, when I use log, the field of the field is displayed, but when I use size, match, or a function, nothing is displayed. Can anyone help me with the solution?

Best regards! 

 

3 answers

0 votes
Tudor Tofan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2025

Hi @Florian Beqiri !

I would go for a more simplistic approach:

If the texts is always of this format, I would use the split(",") function and then apply the size() function.

it would be something like this: issue.customfield.split(",").size

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2025

Hi @Florian Beqiri 

For a question like this, context is important for the community to help.  Please post the following:

  • what type of project is this: company-managed, team-managed, JPD, etc.
  • an image of your complete automation rule in a single image for continuity
  • images of any relevant actions / conditions / branches
  • an image of the audit log details showing the rule execution
  • explain what is not working as expected and why you believe that to be the case

Until we see those...

The automation match() function can have challenges with some field formatting and there is no documentation of what does (or does not) work with regex.  Instead, the doc only states the "underlying implementation is based on Java's Pattern class".  Experimentation is key to confirm what works, perhaps starting with a very simple expression, testing that, and incrementally adding edge cases.

Maybe try this as a start, using an example custom field ID:

{{issue.customfield_12345.replace("\n", " ").match("(example\-cf.*\.example\.local)").size|0}}

Please note the replacement of any newlines and adding escaping for characters that could be interpreted as reserved tokens in the expression.

That would be the total count. If you want the unique count, add a distinct function:

{{issue.customfield_12345.replace("\n", " ").match("(example\-cf.*\.example\.local)").distinct.size|0}}

 

Kind regards,
Bill

0 votes
Florian Beqiri November 20, 2025

A step by step solution would be really helpful! 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events