Description: Sample Groovy Script for pushing issues on a federated Model to 3D Repo.
Click here to learn more.
Context: Document
Document Type: File
Remark: Accessible in Post task mode only.
Script:
def execute() {
String teamSpace="Asite_internal";
String apiURL="https://www.3drepo.io/api";
String apikey="Enter_API_Key_here";
String modelId="Enter_Model_ID_here";
String hostURL = apiURL + "/" + teamSpace + "/" + modelId + "/issues.bcfzip?key=" + apikey;
String apiRequestType = "POST";
String uploadFileParamName = "file";
String bcfFilePath = customObjectService.prepareBCFFile();
Map<Object, Object> uploadFileMap = new HashMap<>();
uploadFileMap.put(IGroovyConstant.FILE_LOCATION, bcfFilePath);
uploadFileMap.put(IGroovyConstant.API_URL, hostURL);
uploadFileMap.put(IGroovyConstant.API_REQUEST_TYPE, apiRequestType);
uploadFileMap.put(IGroovyConstant.UPLOAD_FILE_PARAM_NAME, uploadFileParamName);
customObjectService.pushBCFFile(uploadFileMap);
}