diff --git a/api/src/org/labkey/api/qc/TsvDataExchangeHandler.java b/api/src/org/labkey/api/qc/TsvDataExchangeHandler.java index 8060e132f95..924b731bb8d 100644 --- a/api/src/org/labkey/api/qc/TsvDataExchangeHandler.java +++ b/api/src/org/labkey/api/qc/TsvDataExchangeHandler.java @@ -118,6 +118,7 @@ public enum Props { protocolId, // protocol row id protocolLsid, protocolDescription, + reRunId, // row id of the run being replaced, only present for a re-import runDataFile, runDataUploadedFile, @@ -491,6 +492,14 @@ private Map getContextProperties(DataTransformService.TransformO FileLike originalFileLocation = context.getOriginalFileLocation(); if (originalFileLocation != null) map.put(Props.originalFileLocation.name(), originalFileLocation.toNioPathForRead().toFile().getPath()); + + // Note: the replaced run isn't marked as replaced until after the transform, this is the RowId of the run that is being re-imported + if (!(context instanceof SampleRunUploadContext)) + { + Long reRunId = context.getReRunId(); + if (reRunId != null) + map.put(Props.reRunId.name(), String.valueOf(reRunId)); + } } map.put(Props.baseUrl.name(), AppProps.getInstance().getBaseServerUrl() + AppProps.getInstance().getContextPath());