Is there a way to check if the attachment is successfully added (Antivirus scan is completed) on the service portal?

Palle
Tera Contributor

Hi Community, 

We had an intermittent issue of uploading attachments to the system through service portal. We are experiencing an error (the attachment is available after successful scan), and it is coming when the user uploads an attachment on SC Catalog Item widget and hits submit button simultaneously (suspecting the cause of the error message is coming when doing virus scan of attachment and submitting ticket simultaneously) this can be reproducible on OOB widget. I've reached out to Snow support and they are working on to create a PRB. Meanwhile, I wanted to do a workaround to make the submit button readonly when user uploads the attachment (system scans for antivirus and finish upload the attachment successfully) then make the submit button available for the user to submit the form.

Is there a way to check the state of the attachment upload from the portal? I am working (alert statements) on the below client controller script from SC Catalog Item widget, I am able to get the state as pending but unable to get the state once the system finish scanning and uploaded the attachment successfully. Any help?

spUtil.recordWatch($scope, "sys_attachment", "table_sys_id=" + $scope.data._generatedItemGUID, function(response, data) {
        $scope.attachmentHandler.getAttachmentList();

if (response.data) {
            var options = {};
            options.operation = response.data.operation;
            options.filename = response.data.display_value;
            options.state = (response.data.record && response.data.record.state) ? response.data.record.state.value : "";

alert('state: '+options.state); // here the state is pending;
            if (options.operation === 'update' && options.state === 'not_available')
                $rootScope.$broadcast("$$uiNotification", {type: 'error', message: i18n.getMessage('Upload file scan failed').withValues([options.filename])});

}
        alert('state: '+ options.state); // here the state is also pending;
    });

0 REPLIES 0