Forums

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

smart value match string vs. list

e38383
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 17, 2022

I need to extract some information from description and put it in summary:

{{issue.description.match("foo (xxx-[0-9]*)"}}

This works ok, but sometimes there are just too many results and it breaks the char limit for summary. I tried this:

{{issue.description.match("foo (xxx-[0-9]*)".join(", ").abbreviate(100)}}

Also works correct if there are more than one result. My problem is handling of only one result. match() gives a string if there is only one result and therefore join() doesn't work anymore and outputs an empty string.

Is there any way to check if the result is a list and behave differently? Or is there any way to abbreviate the whole default string match() gives as result (element1, element2, element3)?

0 answers

Suggest an answer

Log in or Sign up to answer