Steps to Reproduce:
Create an two JIRA<>ALM automation for Story<>Requirement & Subtask <>Requirement
Do the below mappings for both automations
Expected Results:
Subtask should be created under respective Parent Story in ALM
Actual Results:
Subtask record getting failed with below error in first attempt and in second sync attempt getting created outside parent folder
Caused by: com.go2group.connectall.adapter.model.exception.ConnectAllException: Response Status: 400 Reason: Bad Request Message <?xml version="1.0" encoding="UTF-8" standalone="yes"?><QCRestException><Id>qccore.invalid-value-type-for-field</Id><Title>Failed to convert the 'parent-id' field of a 'requirement'. The object NAV-44 cannot be converted to type Integer</Title><ExceptionProperties><ExceptionProperty Name="entity-name" Value="requirement"/><ExceptionProperty Name="field-name" Value="parent-id"/></ExceptionProperties></QCRestException>
3.5.0
DE153872
replace
message.payload.addSingleValueField("_parentLinkedId",parentKey);
with message.payload.setSingleValueField("_parentLinkedId",parentKey);
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Logger logger = LogManager.getLogger("com.go2group.connectall.model.transformer.model.api.Jira-to-ALM-Parent");
def _parentDtlMap = (java.util.Map) message.payload.getSingleValueFieldAsObject("_parent id");
logger.info("~~~~~~Jira Parent to ALM Parent~~~~~~");
logger.info("Jira Parent is: "+ _parentDtlMap);
// Proceed only if parent details exist on the record
if(_parentDtlMap != null) {
def parentKey = _parentDtlMap.get("parentId");
logger.info("Parent Key is: " + parentKey);
// If linked id is found for the parentid of the record, then set it back to the record
if (parentKey != null && !parentKey.isEmpty()){
//message.payload.setSingleValueField("_parentLinkedId",parentKey);
message.payload.setSingleValueField("_parentLinkedId",parentKey);
}
} else {
logger.info("Field copy rule does not apply to this transaction.");
}
return message.payload;