Freezing Attachments in Approval Gates ("Authorize" & "Authorize Implementation")

ROSHINIB
Tera Contributor

We have a requirement where attachments on Change Requests and Change Tasks must be frozen (i.e., no changes or deletions allowed) once the record reaches the "Authorize" and "Authorize Implementation" approval gates. This is similar to how other fields are locked during these stages.

We want to ensure that attachments remain intact and cannot be modified or removed once the approval stage is reached.
Question:
Is it possible to configure in Service Operations Workspace so that attachments are frozen in the "Authorize" and "Authorize Implementation" approval gates? If yes, could you please provide the configuration steps we need to follow to achieve this?

2 REPLIES 2

Sanjay191
Kilo Patron

Hi @ROSHINIB 

Yes, it is possible to restrict (freeze) attachments in Service Operations Workspace during specific approval gates.

This can be achieved by creating Before Insert and Before Delete Business Rules And ACL as well on the sys_attachment table. In these Business Rules, you can check the state of the parent record and restrict users from inserting or updating attachments when the record is in the “Authorize” or “Authorize Implementation” states.

Since attachments are always stored in the sys_attachment table, restricting insert/update operations at this level will effectively prevent users from adding or modifying attachments during the specified approval stages.

so please refer the below logic this will help you.

Note: please modify this code according to your requirement  its just a reference. and also you can do for the change task table as well.

    // Add your code here
    if (current.operation() == 'insert') {
        var grChange = new GlideRecord('change_request');
        if (grChange.get(current.table_sys_id.toString())) {
            if (grChange.getValue('state') == 'Authorize Implementation' && grChangeDet.getValue('state') == 'Authorize') {
                gs.addErrorMessage("You can not add the attachment.");
                current.setAbortAction(true);
            }
        }
    }

    if (current.operation() == 'delete') {
        var grChangeDet = new GlideRecord('change_request');
        if (grChangeDet.get(current.table_sys_id.toString())) {
            if (grChangeDet.getValue('state') == 'Authorize' && grChangeDet.getValue('state') == 'Authorize Implementation) {
                gs.addErrorMessage("You can not delete the attachment.");
                current.setAbortAction(true);
            }
        }
    }


If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You

Hi @ROSHINIB 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You