@@ -246,8 +246,8 @@ func RunIntegration(integration db.Integration, project db.Project, r *http.Requ
246246
247247 log .Info (fmt .Sprintf ("Running integration %d" , integration .ID ))
248248
249- var envValues = make ([]db.IntegrationExtractValue , 0 )
250- var taskValues = make ([]db.IntegrationExtractValue , 0 )
249+ var envValues = make ([]db.IntegrationExtractValue , 0 )
250+ var taskValues = make ([]db.IntegrationExtractValue , 0 )
251251
252252 extractValuesForExtractor , err := helpers .Store (r ).GetIntegrationExtractValues (project .ID , db.RetrieveQueryParams {}, integration .ID )
253253 if err != nil {
@@ -257,7 +257,7 @@ func RunIntegration(integration db.Integration, project db.Project, r *http.Requ
257257
258258 for _ , val := range extractValuesForExtractor {
259259 switch val .VariableType {
260- case "" , db .IntegrationVariableEnvironment : // "" handles null/empty for backward compatibility
260+ case "" , db .IntegrationVariableEnvironment : // "" handles null/empty for backward compatibility
261261 envValues = append (envValues , val )
262262 case db .IntegrationVariableTaskParam :
263263 taskValues = append (taskValues , val )
@@ -281,7 +281,7 @@ func RunIntegration(integration db.Integration, project db.Project, r *http.Requ
281281 Environment : environmentJSONString ,
282282 IntegrationID : & integration .ID ,
283283 }
284-
284+
285285 // Only assign extractedTaskResults to Params if it's not empty
286286 if len (extractedTaskResults ) > 0 {
287287 taskDefinition .Params = extractedTaskResults
@@ -293,7 +293,7 @@ func RunIntegration(integration db.Integration, project db.Project, r *http.Requ
293293 return
294294 }
295295
296- _ , err = helpers .TaskPool (r ).AddTask (taskDefinition , nil , integration .ProjectID , tpl .App .NeedTaskAlias ())
296+ _ , err = helpers .TaskPool (r ).AddTask (taskDefinition , nil , "" , integration .ProjectID , tpl .App .NeedTaskAlias ())
297297 if err != nil {
298298 log .Error (err )
299299 return
@@ -321,27 +321,27 @@ func Extract(extractValues []db.IntegrationExtractValue, r *http.Request, payloa
321321}
322322
323323func ExtractAsAnyForTaskParams (extractValues []db.IntegrationExtractValue , r * http.Request , payload []byte ) db.MapStringAnyField {
324- // Create a result map that accepts any type
325- result := make (db.MapStringAnyField )
326-
327- for _ , extractValue := range extractValues {
328- switch extractValue .ValueSource {
329- case db .IntegrationExtractHeaderValue :
330- // Extract the header value
331- result [extractValue .Variable ] = r .Header .Get (extractValue .Key )
332-
333- case db .IntegrationExtractBodyValue :
334- switch extractValue .BodyDataType {
335- case db .IntegrationBodyDataJSON :
336- // Query the JSON payload for the key using gojsonq
337- rawValue := gojsonq .New ().JSONString (string (payload )).Find (extractValue .Key )
338- result [extractValue .Variable ] = rawValue
339-
340- case db .IntegrationBodyDataString :
341- // Simply use the entire payload as a string
342- result [extractValue .Variable ] = string (payload )
343- }
344- }
345- }
346- return result
347- }
324+ // Create a result map that accepts any type
325+ result := make (db.MapStringAnyField )
326+
327+ for _ , extractValue := range extractValues {
328+ switch extractValue .ValueSource {
329+ case db .IntegrationExtractHeaderValue :
330+ // Extract the header value
331+ result [extractValue .Variable ] = r .Header .Get (extractValue .Key )
332+
333+ case db .IntegrationExtractBodyValue :
334+ switch extractValue .BodyDataType {
335+ case db .IntegrationBodyDataJSON :
336+ // Query the JSON payload for the key using gojsonq
337+ rawValue := gojsonq .New ().JSONString (string (payload )).Find (extractValue .Key )
338+ result [extractValue .Variable ] = rawValue
339+
340+ case db .IntegrationBodyDataString :
341+ // Simply use the entire payload as a string
342+ result [extractValue .Variable ] = string (payload )
343+ }
344+ }
345+ }
346+ return result
347+ }
0 commit comments