4.x
This use case requires special handling in order to process the tags as per need. This can be achieved via business script.
Please use below Business Script to separate the tags before syncing to Rally. Execution type = PRE_MAPVALUES
/* ****************************************************************************************************************
* Pre-Requisites:
* Field mapping with Flat File Adapter(Tags) and Rally(Tags) should be present
* ****************************************************************************************************************
* Usage:
* 1. Add below script as it is with execution type PRE_MAPVALUES
* 2. Associate the script with the automation you are intending to use.
* ****************************************************************************************************************/
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.go2group.connectall.config.model.bean.*;
Logger log = LogManager.getLogger('com.go2group.connectall.model.transformer.model.api.RallyTags')
log.info("Applying Custom Business Rule to ConnectAll FF Adapter to sync Tags separately")
Entity record = context.getRecord()
def _tags = record.getSingleValueField("Tags")
// 1. Add a Null Check to prevent NullPointerExceptions
if (_tags != null && !_tags.trim().isEmpty()) {
log.info("Original FF Adapter Tags value is: " + _tags)
def _delimiter = ';'
def splitTags = _tags.split(_delimiter)
// 2. Convert to ConnectAll Value objects
def valueList = Value.getValues(splitTags)
log.info("This is from ValueList: " + valueList)
record.setSingleValueField("Tags", valueList)
} else {
log.info("Tags field is empty or null. Skipping transformation.")
}
return record;