- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 12:33 PM
Does anyone know how to add make a custom attachment button widget work on the service portal for the service catalog?
In Helsinki, this worked fine:
<a href="javascript:void(0)" class="panel-button sp-attachment-add" onclick="jQuery('#attachment_add').click();">
<span class="glyphicon glyphicon-paperclip"></span>
</a>
In Jakarta patch 6, the button no longer responds (it does nothing). Can anyone help?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 12:57 PM
Check out the widget I've posted on ServicePortal.io, there I have an example of a custom widget that triggers the attachment.
https://serviceportal.io/downloads/require-attachments/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 12:47 PM
Reference: Service Portal and client scripts
The following globals and APIs are unavailable in client scripts and catalog client scripts used in the Service Portal:
- window
- document
- $
- jQuery
- $$
- $j
- angular
Out of the box, there is an attachment icon already on the Catalog item widget. Are you trying to add the attachment icon somewhere else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 12:48 PM
Yes. It would be a button that does the same thing.... don't ask.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 12:49 PM
You'll need to create an attachment widget and embed it as a macro variable on your catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 12:50 PM
I understand this. This is how it is currently set up. However, the existing code is not working. My question is: how can I make it work?