Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need to create automation for insight plugin

Need to write groovy scripts for insight automation for attribute value action.

I want to extract only JT from John Tom(JT) from Attribute value.

We have two fields attribute1 and attribute2 need to save both values in attribute3 = attribute1 - attribute2 

Suppose attribute1 value is John Tom(JT) and attribute2 value is abcd

attribute3 = JT-abcd

1 answer


you could use the regex matcher:

def field1 = "John Tom(JT)"
def field2 = "abcd"
def field3 = (field1 =~ /\(([A-Z]{2})\)/).findAll().last()[1] + '-' + field2

//Result: 'JT-abcd'

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

🍂📹 Apptoberfest demo contest roundup: vote for your favorite demos!

Hi Community! The submissions are in (and listed below) for the 🍻🍂Apptoberfest🍂🍻 Demo Competition and it’s time for you to place your votes for the best: Analytics & reporting app demo ...

103 views 2 11
Read article

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