├── app.css ├── assets ├── icon.png ├── logo.png └── logo-small.png ├── README.md ├── manifest.json ├── app.js ├── translations └── en.json └── LICENSE /app.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zendesk/attachment_finder_app/master/assets/icon.png -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zendesk/attachment_finder_app/master/assets/logo.png -------------------------------------------------------------------------------- /assets/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zendesk/attachment_finder_app/master/assets/logo-small.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Simple no template app to add a tag to tickets with attachments. This tag can then be used in reporting, views, etc. The tags used can be modified in the app's settings. 2 | 3 | Note: Your use of this app should be at your own caution, it is currently not supported, officially or otherwise. 4 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Attachment Finder", 3 | "author": { 4 | "name": "Adam Lobb", 5 | "email": "alobb@zendesk.com", 6 | "url": "" 7 | }, 8 | "defaultLocale": "en", 9 | "version": "1.0", 10 | "noTemplate":true, 11 | "private": false, 12 | "location": "ticket_sidebar", 13 | "version": "1.0", 14 | "frameworkVersion": "1.0", 15 | 16 | "parameters": [ 17 | { 18 | "name" : "Current Attachments Tag", 19 | "type" : "text", 20 | "required" : true 21 | }, 22 | 23 | { 24 | "name" : "Previous Attachments Tag", 25 | "type" : "text", 26 | "required" : true 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | return { 4 | events: { 5 | 'ticket.save':'findAttachments' 6 | }, 7 | 8 | findAttachments: function() { 9 | 10 | var comment = this.comment(), 11 | ticket = this.ticket(); 12 | 13 | var setting2 = this.setting('Previous Attachments Tag'); 14 | 15 | ticket.comments().forEach(function(comment) { // Checks all but current comment for attachments 16 | var firstImageAttachment = comment.imageAttachments().get(0); 17 | var firstNonImageAttachment = comment.nonImageAttachments()[0]; 18 | 19 | if (firstImageAttachment !== undefined || firstNonImageAttachment !== undefined) { 20 | ticket.tags().add(setting2); 21 | } 22 | 23 | }); 24 | 25 | var setting1 = this.setting('Current Attachments Tag'); 26 | 27 | if (comment.attachments().length > 0) { // Checks current comment for attachments 28 | ticket.tags().add(setting1); 29 | } 30 | 31 | return true; 32 | 33 | } 34 | }; 35 | 36 | }()); 37 | -------------------------------------------------------------------------------- /translations/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": { 3 | "package": "app_name", 4 | "description": { 5 | "value": "Play the famous zen tunes in your help desk.", 6 | "title": "app description" 7 | }, 8 | "name": { 9 | "value": "Buddha Machine", 10 | "title": "app name" 11 | } 12 | }, 13 | 14 | "loading": { 15 | "value": "Welcome to this Sample App", 16 | "title": "loading placeholder" 17 | }, 18 | 19 | "fetch": { 20 | "done": { 21 | "value": "Good", 22 | "title": "fetch success" 23 | }, 24 | "fail": { 25 | "value": "failed to fecth information from the server", 26 | "title": "fetch failure" 27 | } 28 | }, 29 | 30 | "id": { 31 | "value": "ID", 32 | "title": "user id" 33 | }, 34 | 35 | "email": { 36 | "value": "Email", 37 | "title": "user email" 38 | }, 39 | 40 | "name": { 41 | "value": "Name", 42 | "title": "user name" 43 | }, 44 | 45 | "role": { 46 | "value": "Role", 47 | "title": "user role" 48 | }, 49 | 50 | "groups": { 51 | "value": "Groups", 52 | "title": "user groups" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Zendesk 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Capitalized terms used herein have the meaning set forth in the Zendesk, Inc. 16 | (“Zendesk”) Terms of Service (available at www.zendesk.com/company/terms) (the “Terms”). 17 | The software made available herein constitutes “ZendeskLabs Software” which may be 18 | implemented to enable features or functionality to be utilized in connection with a 19 | subscription to the Service. 20 | Notwithstanding anything to the contrary set forth in the Terms or any other 21 | agreement by and between you and Zendesk, ZendeskLabs Software is provided 22 | “AS IS” and on an “AS AVAILABLE” basis, and that Zendesk makes no warranty 23 | as to the ZendeskLabs Software. 24 | 25 | ZENDESK DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 26 | TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 27 | NONINFRINGEMENT AND THOSE ARISING FROM A COURSE OF DEALING OR USAGE OF TRADE 28 | RELATED TO THE ZENDESKLABS SOFTWARE, ITS USE OR ANY INABILITY TO USE IT OR 29 | THE RESULTS OF ITS USE. 30 | 31 | Use of ZendeskLabs Software is subject to the following risks and conditions: 32 | (i) the ZendeskLabs Software is not an component of the Service that 33 | has been designed for commercial release for by Zendesk; 34 | 35 | (ii) the ZendeskLabs Software may not be in final form and may contain errors, 36 | design flaws or other problems; (iii) the ZendeskLabs Software is not expected to 37 | function fully or adequately upon installation, and it is expected and anticipated that 38 | further testing, modification and development may be necessary to make the 39 | ZendeskLabs Software functional; 40 | 41 | (iv) it may not be possible to make the ZendeskLabs Software functional; 42 | 43 | (v) use of the ZendeskLabs Software may result in unexpected results, loss of data, 44 | project delays or other unpredictable damage or loss; and 45 | 46 | (vi) Zendesk is under no obligation to release and/or offer for sale commercial 47 | versions of the ZendeskLabs Software, and Zendesk has the right to unilaterally 48 | abandon development or availability of the ZendeskLabs Software at any time and 49 | without any obligation or liability to You. You further agree that Zendesk shall 50 | have no obligation to correct any bugs, defects or errors in the ZendeskLabs Software 51 | or otherwise to support or maintain the ZendeskLabs Software. 52 | 53 | If you elect to utilize any ZendeskLabs Software, you are agreeing to release Zendesk 54 | from any claim with regard to the ZendeskLabs Software, its operation, availability or 55 | its failure to operate or be available. Without limiting the generality of the foregoing, 56 | 57 | You acknowledge and agree that neither the use, availability nor operation of any 58 | ZendeskLabs Software shall be subject to any service level commitment applicable to the Service. --------------------------------------------------------------------------------