Enhancing Attachment Visibility in ServiceNow

Roderick De Guzman - 16th April 2012

Ever received a similar business requirement for your ServiceNow platform that states, “When a file is attached to a Task (e.g. Request or Change Task as part of a parent Request/Change record), the parent record must have visibility of the all attached files across all its related Tasks.”

The diagram above illustrates this requirement. From an “out-of-the-box” instance, attachments can only be directly accessed from its associated record. In this case, you can only access a Change Task’s attachments by going directly into that Change Task. Watch the video first before you continue.

The example below will explore this requirement but in the context of delivering a Request from the Service Catalog.
 

The Challenge

When delivering Catalog Items (eg. Request Item), the workflow associated to each item can be as simple as a handful of tasks to a complex delivery model with 10+ tasks, many of them assigned to different fulfilment groups. Below is a typical example of a PC delivery workflow.


Often, with each of these tasks, files are needed to be attached to supplement its approval, procurement, fulfilment or closure. Whether it’s a signed approval from a manager, scanned purchase orders, delivery receipt or configuration documents, these need to be attached to a Request Task and managed throughout the entire process. The attachment functionality within ServiceNow is very useful, if not too simplistic.

However, managing the attachments “out-of-the-box” within each of the Request Tasks is not very pragmatic if you are the Request Owner (eg. someone who is responsible for the Request from start to end).

With no easy way to identify which tasks have attachments, or to see when new attachments have been added, the typical default work instruction provided to users is to manually go through each and every task, looking for attachments. Clearly this approach becomes very cumbersome and tedious.

The challenge here is to keep the “out-of-the-box” ServiceNow functionality of easily adding attachments to individual tasks, while giving the Request Owner visibility of all attachments from a single location.
 

The Approach

Our goal is to simplify attachment management within the service delivery teams, without removing the ease of use and intuitive “out-of-the-box” attachment functionality.

The solution must keep attachments visible and accessible to Task Owners, while offering this same visibility and accessibility of attachments to the Request Owner.

If we look at how a Request Owner manages the delivery workflow, we could design a suitable solution which compliments this behaviour. The Request Owner will open the case to view its status and its associated tasks. A sample screenshot is provided below to illustrate what this view may look like.

The solution must allow the Request Owner to see all attachments in this same view. With this design factor, the approach is to ‘propagate’ attachments from each Request Task to the parent Request Record, while keeping them visible within each Request Task.

To keep the solution consistent with the overall look and feel, the Relational Tabs at the bottom of the record becomes an obvious position to store a list of attachments from all tasks. In addition, along with a list of all attachments, details of which Request Task it was attached to would provide that extra visibility required by the Request Owner. The result is a one stop shop for all attachments across all associated Request Tasks:


 

The Solution

In summary, a business rule is added to the “attachments” table which waits for a file to be added to any Service Catalog Request Task. This rule is run on the server in the background immediately after a file has been attached to the Request Task. It does not require any additional input from the attachment owner, nor does it impact performance.

Before creating this rule, a new custom column was added to the “attachments” table so we could always link the attachment back to its source (hence the field name u_source as seen in the script below).

var gr = new GlideRecord(‘sc_task’);
if ( gr.get(current.table_sys_id)) {
current.u_source = current.table_sys_id;
current.table_name = ‘sc_req_item’;
current.table_sys_id = gr.parent.sys_id;
current.update();
}

The solution is achieved whilst not duplicating/replicating the attachments (eg. one for the Request Task and replicated for the Request Record). The above is just a subset of the key configuration elements required to enable this enhancement.
 

The Benefits

Using this simple yet effective enhancement, a Request Owner receives improved visibility for attachments that are added throughout the entire workflow including in each Request Task. Attachments relating to a particular Request Record are shown and accessible in one central location.

The end result is increased efficiency by getting rid of extra user clicks and improves overall visibility for a Request Owner to manage all files that have been attached via an associated Request Task.

This similar enhancement can be deployed across all other processes such as Incident, Problem and Change Management.