Need to create automation for insight plugin

Ankuskum May 5, 2020

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

0 votes
Tobias Ravenstein June 3, 2020

Hi,

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
TAGS
AUG Leaders

Atlassian Community Events