HowTo: Create a query for quick-downloading attachments

Version 8

    Table of content

     

    Overview

    Currently, Ivanti Service Desk does not have a feature that can be used to easily access and download attachments linked to cases without having to open and download them one by one. Hence I propose here a solution based on the combination of a Query and a Report Template, that will return attachments (after configurable filtering) and add a quick download button for each of them.

     

    The basic idea here is to create a Query that will return all attachments of a specific type of ticket (since attachments are separately stored based on their parent's class type: Incident, Request, Call, etc.). Then displaying this query using a Report Template on WebAccess/Workspaces, you will be able to add a hyperlink for your users to download an attachment with one click directly from the query's list of returned items.

     

    Further criteria on the query can be used to order, group and filter the items you want to return (for example showing only the attachments of cases raised by the user viewing the query, or show only the attachments that were added by the user).

    This guide will give you a basic configuration that can then be personalized to best meet your business requirements and preferences.

    Note: This guide will show you how to do this for Incident Attachment. The behavior will be the same for any other type of attachment as long as the correct attributes and business object are modified according to the class type of the object.

    This solution will work on both WebAccess and Workspaces, but they will need a slightly different configuration. Any differences will be noted to ensure you know which part is configured for which client, and you will be able to implement one solution without the other if you wish. This HowTo document will be cut in two main parts to better guide you and highlight the differences of configuration in the Console and in the web clients.

     

    Configuration from Service Desk Console

    Creating the base query

    Firstly, a query returning the incidents' attachments needs to be created for us to base our WebAccess and Workspaces reports on:

    1. Log into the Console as an administrator, go to the Query and Report Designer and create a new system query on 'Incident Management > Attachment';
    2. Add a couple of attributes under 'Attributes' - they will only be used for ordering or grouping as we will display the query using a report template that will overwrite the returned data - see our Help Center here for further information about grouping data in the Query and Report Designer;
    3. Under 'Criteria', add the filters you want to apply to narrow down the attachments returned. This can be modified later without any problem.
      If you need some guidance for creating your own filtering I invite you to have a look at our Service Desk Help Center, especially the sections under Design and administration > System design > Query and Report Designer > Query Criteria (see here);
    4. When your ordering and filtering configuration met your need, save the query.

     

    Creating the Report Templates

    After the query had been created we need to create the report templates (one for each web client) to create the personalized display that will host the quick download button. Go to the Object Designer, and under 'Incident Management > Attachement > Properties > Reports' add a new report template.

    Warning: This is where the configuration begin to differ for WebAccess and Workspaces. If you want to add this to both web clients, follow both sections in any order. If not, simply follow the steps of the relevant web client configuration.

    Note: To prevent confusion with WebAccess and Workspaces' templates I advise you to name them mentioning for which client they are for, such as 'Attachment Quick download - WebAccess' and 'Attachment Quick download - Workspaces'.

     

    For WebAccess

    Paste inside the 'Text' box the following:

    <font size="2" >

    <table class="reportFixedWidth" width="1200px">

    <tr>

     

    <td width="100px">

    <strong>Incident ID: </strong><br>

    {Incident/ExtendedId}

    </td>

     

    <td width="200px">

    <strong>Incident Summary: </strong><br>

    {Incident/Title}

    </td>

     

    <td width="200px">

    <strong>Attachment title: </strong><br>

    {Title}

    </td>

     

    <td width="200px">

    <a href="http://localhost/ServiceDesk.WebAccess/ss/Object/GetAttachment.rails?class_name=IncidentManagement.Attachment&key={Guid}&attribute=AttachmentDocument">

    <strong>Click here to quick-download the attachment</strong></a><br>

    </td>

     

    </table>

    This will take various data from both the incident and its attachments and returned them formatted as configured in the HTML: the orange parts are the placeholders that will pull the data from the ticket/attachment and print them on the report.

    The last part with the URL will be the quick-download hyperlink of the attachment returned by the query.

    Make sure to modify the red part to match your server and WebAccess instance name, and amend the blue part accordingly if you want to configure the template for a different ticket class type (for example, if you want to have that for Requests' attachment it will be: 'RequestManagement.Attachment').

     

    Here is how this template should look within WebAccess:

    Note: To further personalize and configure the template I invite you to have a look at the following article that shows great examples of Report Templates you could use or base your own design on: Report Template Example you may like

    When you are satisfied with the template, validate and save the change made on the business object.

     

    For Workspaces

    The template for Workspaces is going to work very much the same, but the most important difference is in the URL the application use to download attachements. As a basic template you can use the same as for the WebAccess version but the last part will have to be changed to match the URL as shown below:

    <font size="2" > 

    <table class="reportFixedWidth" width="1200px"> 

    <tr>

     

    <td width="100px">

    <strong>Incident ID: </strong><br>

    {Incident/ExtendedId}

    </td>

     

    <td width="200px">

    <strong>Incident Summary: </strong><br>

    {Incident/Title}

    </td>

     

    <td width="200px">

    <strong>Attachment title: </strong><br>

    {Title}

    </td>

     

    <td width="200px">

    <a href="http://localhost/ServiceDesk.BridgeIT/api/object?key={Guid}&class_name=IncidentManagement.Attachment&attribute=AttachmentDocument">

    <strong>Click here to quick-download the attachment</strong></a><br>

    </td>

     

    </table>

    As for the WebAccess version, the red part needs to be amended according to you server and instance name, and the blue part should be modified if the template is for another ticket class type.

    The template given above will look like this in Workspaces:

    As explained previously, to further personalize and configure the template I invite you to have a look at the following article that shows great examples you can use: Report Template Example you may like

     

    Configuration from the web clients

    The last part of this guide is about configuring WebAccess and Workspaces to use both the query and the report template created.

     

    For WebAccess

    1. Create a new Query (either as a standalone query or as a query gadget on a dashboard) on 'Incident Management > Attachment' and after ticking 'View list of Service Desk queries?' choose from the list the query created in the Console section above;
    2. Using the top right corner arrow, view this query as a Report and select the report template created for WebAccess previously;

    3. You can then save this page as a new shortcut that you can publish to other users later: right click somewhere on the left panel and select 'Add this page to shortcut bar';

    Note: When the query is successfully created, you can add further criteria to filter the returned items (in the case you want to use the same basic query published with different filtering for different groups).

    For Workspaces

    Workspaces only allows dashboards to be added on the left panel, meaning that the query can only be added as a query gadget on a dashboard:

    1. Choose which dashboard you want to add this query to, modify it by clicking on the Pencil button , and then add a new Data Grid gadget on 'Incident Management > Attachment';
    2. In the Report Template field, select the one created previously for Workspaces;
    3. Configure as you see fit the rest of the gadget, but I suggest to tick the option 'Prevent Launch' as it could conflict with the hyperlink if user's click is slightly off the hyperlink;
    4. When done, save the changes made on the gadget and its dashboard.

     

    Additional information

    If you need further guidance about the different features mentioned in this guide, you can search through our Help Center: Service Desk and Asset Manager help center or our community space for Service Desk: Ivanti Community - Service Desk and Asset Manager.