The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How do I use regex to convert number to string in a formula column of a structure board?

Pavan Cheruvu
February 21, 2024

Hi : This is the scenario, where I need help. I am using a formula column to sort and pick the latest fixversion.  The fixVersion are stored as "YY.MM.DD" and can have multiple values.

I am taking the strings in fixVersion and converting to a number, by removing the decimal. 

I than sort and pick the highest value. 

----------------

fixVersions

  .map(v -> v.name.replace(".", ""))

  .sortBy(v -> -v)

  .first()

-------------------------------

I now want to add the decimal back to the highest value, before displaying in the structure board.

I have tried various combinations like
.map(v -> v.replace(("\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3"))

but it is not working!

 

Regards, Pavan

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events