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
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'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.