Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

End users not able to download the attachment added using variable

Gaurav Vaze
Kilo Sage

The user is unable to open the attachment attached via the "Attachment" variable.
I tried to open the attachment with my admin account and It did work.

I am trying to download the attachment by impersonating an end user, but when I click on the attachments, it doesn't download but opens a new blank tab showing the sys ID of the attachment.

user has an ITIL role but still, he/she is not able to download the attachments.

These attachments are getting stored in the ZZ_YYsc_cart_item table.

Im not sure what should I check and what next steps should be taken
its affecting the instance and any help will be appreciated
Thank You!!

1 ACCEPTED SOLUTION

Gaurav Vaze
Kilo Sage

I got the solution for this
I created a READ ACl on the sys_attachement table
Type: Record
Operation: Read
Protection Policy: None
I had to check the correct table as due to the custom portal the attachment uploaded through variables gets stored in the 'ZZ_YYsc_cart_item'
following is the script

answer = getSCAttachmentReadAnswer();

function getSCAttachmentReadAnswer() {
    if (current.table_name == 'ZZ_YYsc_cart_item')
        return true;
}

 

View solution in original post

4 REPLIES 4

Gaurav Vaze
Kilo Sage

I got the solution for this
I created a READ ACl on the sys_attachement table
Type: Record
Operation: Read
Protection Policy: None
I had to check the correct table as due to the custom portal the attachment uploaded through variables gets stored in the 'ZZ_YYsc_cart_item'
following is the script

answer = getSCAttachmentReadAnswer();

function getSCAttachmentReadAnswer() {
    if (current.table_name == 'ZZ_YYsc_cart_item')
        return true;
}

 

a5hubh
Tera Expert

 

 

answer = getSCAttachmentReadAnswer();

function getSCAttachmentReadAnswer() {
    if (current.table_name == 'ZZ_YYsc_cart_item')
        return true;
}

 

 

Hey Shubham,
you posted the same script what I did,
If my script helped you, then please mark it as helpful
Thank you
    Gaurav Vaze
ServiceNow Developer

GMoon
Kilo Sage

Thanks for sharing this solution, we had this exact issue.