Link to attachment in email notifications

tchaikin
Giga Expert

I have a requirement on certain tasks to list out the files attached to the task rather than send them as actual email attachments. This is due to the volume and size of attachments on these tasks.

I've successfully created a mail script which lists out the files attached to the task, with a link to each attachment.

find_real_file.png

Where I'm running into trouble is: if a user has no roles in the system (i.e. they are a requestor and not a fulfiller), if they are not already signed in, when clicking the attachment link, after SSO auth they get directed to our portal homepage (i.e. https://instance.service-now.com/sp). If they're already signed in, they are able to directly access the attachment (https://instance.service-now.com/sys_attachment.do?sys_id=XXXXXXXX)

Does anyone have an idea of how I can make it so the user can do access the attachment via a single click, even if they don't have a logged in session? We have SSO enabled, so I'm not concerned about the login process, but like I said, for those without roles, they get directed to the SP homepage after login instead of being able to access their attachment directly as expected.

1 ACCEPTED SOLUTION

Thank you. I'm going to use a combination of updating the login/redirect script as well as a dedicated portal page to make the user experience better.

View solution in original post

9 REPLIES 9

This is the case I'm experiencing. Our SSO supports deep linking just fine as this scenario works for users with roles. It's that ServiceNow sees the user has no roles and throws them to the SP after login.

The issue here is that there is no SP page for an attachment. sys_attachment.do is it - that's how you get attachments even on Service Portal. SN just doesn't like it being the first page visited after login I guess.

What I'll try now is developing a custom portal page that I can deep link to to get the user the attachment and make their experience as painless as I can despite these platform limitations.

Mwatkins
ServiceNow Employee
ServiceNow Employee

Ah... ok, that makes sense. I think you could customize the SPEntryPage URL to send them to sys_attachment.do instead of the default landing page.

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/build/service-portal/concept/c_S...

Thank you. I'm going to use a combination of updating the login/redirect script as well as a dedicated portal page to make the user experience better.

RAHUL Khanna1
Mega Guru
I don't think thats possible , as you have not logged in and if you are clicking a link, it redirects to portal Home page. That's natural behaviour.

Mwatkins
ServiceNow Employee
ServiceNow Employee

Here's another post with some notes about tricky things/challenges another customer has discovered with Deep linking from emails and SSO:

https://community.servicenow.com/community?id=community_question&sys_id=d6fa91efdbf408d013b5fb243996...

Please āœ… Correct if this solves your issue and/or šŸ‘ if Helpful