In ConnectAll Relationships from Jira Subtasks to ALM Requirements broken in version 3.5.0
search cancel

In ConnectAll Relationships from Jira Subtasks to ALM Requirements broken in version 3.5.0

book

Article ID: 379952

calendar_today

Updated On:

Products

ConnectAll On-Prem ConnectAll SaaS

Issue/Introduction

Steps to Reproduce: 

  • Create an two JIRA<>ALM automation for Story<>Requirement & Subtask <>Requirement

  • Do the below mappings for both automations 

  • Story<>Requirement

  • Subtask<>Requirement



     
  • Configure Translated record id for Jira Subtask Parent Id and ALM Parent fields


     
  • Assign attached script to both automations
     
  • Try synching Story and Subtasks
     

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>

Environment

3.5.0

Cause

DE153872

Resolution

  • Login to ConnectAll UI and navigate to manage script and make below changes in the Parent Child relation script.

replace  

 message.payload.addSingleValueField("_parentLinkedId",parentKey);


with
   message.payload.setSingleValueField("_parentLinkedId",parentKey);

Additional Information

  • Script for parent-child relationship

 

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;