Forums

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

Match function

Gilad Waldman
Contributor
September 6, 2025

I have a variable that contains a list of items, separated with comma and I am trying to run on all values and if last latter equals the latter p - Store all of these values in a different custom field. 

was using "endsWith" function but didn't return anything, and was my latest try was the below:

{{#Variablen.split(",")}} {{#if(trim(.).matches(".*p$"))}} {{trim(.)}}{{^last}}, {{/last}} {{/}} {{/}}

Any suggestions?

 

1 answer

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.
September 6, 2025

Hi @Gilad Waldman 

The example you show splits the variable on commas, and then tries to perform a trim() on the implied / unnamed, list item {{.}} followed by the inline iteration match() function in order to filter the list.

Although some functions can use {{.}} during long-format iteration, most cannot, as you are observing.  And, the {{^last}}, {{/}} would apply to the entire iteration, not to just the conditional filtering...thus, potentially leaving a trailing comma-space at the end.

 

As an alternative, you can solve this scenario completely with inline iteration with a trim prior to the attempted match, with a small change to your regex.  Then, add an explicit join for the delimiter.

{{Variablen.split(",").trim.match("^(.*p)$").join(", ")}}

 

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events