SNOW: RITM sc_task variables -> Jira Cloud

JIRA incoming
if(firstSync){

// change the projectKey
   issue.projectKey   = "MAT" 
   // Set type name from source issue, if not found set a default
   issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
}
issue.summary      = replica.summary
issue.description  = "This is question 2:" + replica.variables."This is question 2" + "\n" + "This is question 1:" + replica.variables."This is question 1" 
issue.comments     = commentHelper.mergeComments(issue, replica)
issue.attachments  = attachmentHelper.mergeAttachments(issue, replica)
issue.labels       = replica.labels
SNOW outgoing
Map<String, String> buildVariablesMap(String requestItemNumber) {
    def limitResult = 20

    def Map<String, Object> result = [:]

    def sys_id = entity.sys_id
    
    def optionList = httpClient.get("/api/now/table/sc_item_option_mtom?sysparm_query=${sys_id}")    
    if (!optionList || !optionList.result) return null  // ignore if there are no results
    //https://ven03945.service-now.com/api/now/table/sc_item_option_mtom?sysparm_query=sc_task.number=d686643b1baed1109461ca207e4bcbba
    
    // For each of the options, lookup corresponding question and add to the result map
    optionList.result.each { 
        def optionSysId = it.sc_item_option?.value
        
        def optionDetails = httpClient.get("/api/now/table/sc_item_option/${optionSysId}")
        if (!optionDetails || !optionDetails.result) return // ignore - the option itself is not found
        
        def itemOptionNew = optionDetails?.result?.item_option_new?.value
        if (!itemOptionNew) return  // ignore - link to question not found
        
        def itemOptionNewDetails = httpClient.get("/api/now/table/item_option_new/${itemOptionNew}")
        if (!itemOptionNewDetails || !itemOptionNewDetails.result) return // ignore - the question is not found
        
        
        result.put ( itemOptionNewDetails.result.question_text, optionDetails.result.value)        
    }
    return result
        
}

if(entity.tableName == "sc_task" || entity.tableName == "catalogTask" || entityType == "catalog_task" || entityType == "catalogTask") {
  
    replica.key            = entity.key
    replica.summary        = entity.short_description
    replica.description    = entity.description
    replica.name           = entity.name
    replica.variables      = buildVariablesMap(entity.key)
    replica.sys_id         = entity.sys_id}