Attachment related Issue on service portal

yashgarg
Tera Contributor

Hi,

 

I have a doubt in one requirement is given to me i.e., On the incident form state is resolved of incident after that I want to attach the attachments on incident form but they can't show on my approvals on service portal and I also want to do that on portal as well. So, How to manage this in ServiceNow Anyone please help me on this.

 

Thanks

Yash

1 ACCEPTED SOLUTION

Deepak Shaerma
Mega Sage

Hi @yashgarg 

If your incident gets Resolved, then why do need approvals on the incident??
But for custom requirement, you can create a Business Rule that copies the attachment from the Incident to the Approval record whenever a new attachment is added or when an approval is generated.

(function executeRule(current, previous /*null when async*/) {
    // Find the approval record related to this incident
    var approvalGR = new GlideRecord('sysapproval_approver');
    approvalGR.addQuery('sysapproval', current.table_sys_id);
    approvalGR.query();
    
    while (approvalGR.next()) {
        // Copy the attachment to the approval record
        GlideSysAttachment.copy('incident', current.table_sys_id, 'sysapproval_approver', approvalGR.getUniqueValue());
    }
})(current, previous);



Happy to help! ‌‌
To help others in the community find this solution, kindly mark this response as the Correct Answer ‌‌ and Helpful‌‌.
Warm Regards,
Deepak Sharma
Community Rising Star 2025

View solution in original post

3 REPLIES 3

SumanthDosapati
Mega Sage

@yashgarg 

Your requirement is not clear. Why do you want to show attachments in My Approvals page?

 

Regards,
Sumanth

Ankur Bawiskar
Tera Patron

@yashgarg 

so on resolved INC you want to add file but it's not happening?

share some screenshots

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Deepak Shaerma
Mega Sage

Hi @yashgarg 

If your incident gets Resolved, then why do need approvals on the incident??
But for custom requirement, you can create a Business Rule that copies the attachment from the Incident to the Approval record whenever a new attachment is added or when an approval is generated.

(function executeRule(current, previous /*null when async*/) {
    // Find the approval record related to this incident
    var approvalGR = new GlideRecord('sysapproval_approver');
    approvalGR.addQuery('sysapproval', current.table_sys_id);
    approvalGR.query();
    
    while (approvalGR.next()) {
        // Copy the attachment to the approval record
        GlideSysAttachment.copy('incident', current.table_sys_id, 'sysapproval_approver', approvalGR.getUniqueValue());
    }
})(current, previous);



Happy to help! ‌‌
To help others in the community find this solution, kindly mark this response as the Correct Answer ‌‌ and Helpful‌‌.
Warm Regards,
Deepak Sharma
Community Rising Star 2025