Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Push issues on a federated model to 3D Repo
Groovy Script - Push issues on a federated model to 3D Repo
Updated over a month ago

Description: Sample groovy script for pushing issues on a federated model to 3D Repo.

Click here for detailed help.

Context: Document

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);

}



Did this answer your question?