Hi,
I use these functions to get an insight object in my script.
def incidentSiteId = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(11401)
def incidentSiteValue = issue.getCustomFieldValue(incidentSiteId)
I get the complete value of the object :
>> [3507R+E CHASSIS, TWOWS-X2228-RJ45V+E, SU (CMDBXXXX-22574)]
But I would like to remove all unnecessary formatting
I use for the moment a regex to extract the name text.
I would like to get only the name of the object without bracket and without the CMDB ID.
off topic : if it can help, here is the regex I use :
def incidentAssetmatcher = incidentAssetValue =~ /.*\[(.*?)\(CMDBXXXX/
def incidentAssetResult = (incidentAssetmatcher) ? incidentAssetmatcher[0][1] : null
To optimize my script, is there a simple way like ".label" or ".name" to retrieve the name without full value and without regex ?