FootPrints Service Core Community Blog

SERVICE LEVEL MANAGEMENT WITH NOTIFICATIONS IN FPSC V.12

Posted by on Mar 20, 2017 in FPSC | Comments Off on SERVICE LEVEL MANAGEMENT WITH NOTIFICATIONS IN FPSC V.12

BY STUART WHITE, RIGHTSTAR

 

GOAL

In the Service Portfolio, Service Level Management will be used to identify response and resolution targets based on the work targets. The work targets are system generated objects that are created when a match exists between the service level target and the ticket item. Notifications will be generated based on a percentage of time elapsed since ticket creation and on SLM failure.

The solution used in this case is an exercise that can be formulated to fit any environment. The solution is based on matching the Priority field of the ticket. The assumption being that the ticket priority field is set as single select with choices of Critical, High, Medium, and Low.

Applicability

FootPrints Service Core version 12.x running on Microsoft Windows Server 2008/2012.

Prerequisites

  • Administrator access to FPSC v.12.
  • A complete workspace container with a ticket item, an address book container item, and a service portfolio container item.

 

BACKGROUND

Service Level Management is documented in the BMC Product Documentation guide, however, putting all the functionality together warrants searching various locations in the document. Some Service Level Management information is in the Service Portfolio section and other information is in the business rules section. Without knowing what to look for will lead to confusion.

Service level management (SLM) uses ticket definitions in workspaces and in service portfolios combined with business rules that trigger target date calculations. You must define a business rule for each item in the workspace that you want to interact with SLM and for each Work Target item in the related service portfolio. For example, you can create business rules to send email when a certain percentage of the fulfillment is completed or a certain percentage of the total allowed time has passed.

Service level targets (SLTs) are defined in individual items in your service portfolios. They contain

several built-in fields such as Response Time and Resolution Time.

 

THE SOLUTION

Within the Service Portfolio container and for the Service Level Target, create and add a field named Priority (dropdown; Choices Critical, High, Medium, Low) and add the field to the Agent Web form.

Make sure both the Workspace ticket item and the Service Portfolio Service Level Target have matching Priority fields.

Save and Publish the Service Portfolio.

From the top-level consoles, click More and select Service Portfolio.

Select Actions, New, Service Level Target

Create the following Service Level Targets resolution targets: (Use the Normal Work Week or create a 24X7 Work Schedule)

  • “Critical Resolution Target” 4 Hours
  • “High Resolution Target” 8 Hours
  • “Medium Resolution Target” 24 Hours (or 3 Days)
  • “Low Resolution Target” 80 Hours (or 10 Days)

Additionally, configure these response targets

  • “Critical Response Target” 15 minutes
  • “High Response Target” 15 minutes
  • “Medium Response Target” 15 minutes
  • “Low Response Target” 15 minutes

Three specific relationships must exist: in the Workspace (1 relationship) and the Service Portfolio (2 relationships).

  • In the Service Portfolio add the following 2 relationships
  • Ticket/Work Target (select the Service Portfolio and the Workspace)
  • Work Target/ Service Level Target (select the Service Portfolio for both sides of the screen)
  • Save and Publish the Service Portfolio.

From the Work Target item, click the Fields section.

  • Create the Boolean field “Notification Flag”
    • Place the “Notification Flag” on the Agent form

From the Work Target item, click the Business Rules tab.

  • Create a new Business Rule of type After Save
    • Name the rule: Set State to Breached
    • Trigger: Check every 5 minutes
    • Criteria: Target Date – relative during the past 0 hours based on 24 hour clock AND State equal to “Pending”.
    • Actions: Set Field Value – Set field value of State to “Breached”.
  • Create a new Business Rule of type After Save
    • Name the rule: Notification Flag Check
    • Trigger: Check every 5 minutes
    • Criteria: Elapsed Time % greater than or equal to [notification_threshold___] AND State equal to “Pending”
    • Actions: Set Field Value – Set field value of Notification Flag to checked

Save and Publish the Service Portfolio

Return to Administration | Main and select the Workspace

In the Workspace, add the following relationship

  • Ticket/Work Target (select your Workspace and your Service Portfolio)

From the Forms section, edit the agent web form

  • Add a section named “Work Target(s)”
  • Add a Form Control of type ‘Link Control’ to your Agent Web Form
    • For Link Type, select Ticket/Work Target
    • For Grid Fields select Record Number, Target Type, Status, Target Date, Target Value, Target Unit
  • Save the form.

Create email templates for the SLM notifications.

  • One email template for response notification of impending breach.
  • One email template for resolution notification of impending breach.
  • One email template for response notification of SLM breach.
  • One email template for resolution notification of SLM breach.

From the Incident/Ticket item level, click the Business Rules tab.

  • Create a new Business Rule, of type SLM
  • Name the rule: SLM
  • Trigger: On Create, On Update by User or Rule, On Update by User
  • Criteria: None
  • Actions: Activate Service Response and Resolution Enforcement

From the Incident/Ticket item level click the Business Rules tab.

  • Create a new Business Rule, of type Email Notification Rule
    • Name the rule: SLM Response Notification Rule
    • Trigger: On Linked Item Update: Ticket/Work Target: Work Target
  • Criteria: Generic Linking, Condition of Any, Ticket/Work Target: Work Target – Add New Condition of Notification Field changed from equal to “blank check” to equal to “checked”. Add new condition of Target Type equal to ResponseTime
  • Actions: Send email to Assignees with Email Template of SLM Response Notification, Importance of Normal, check Primary email
  • Create a new Business Rule, of type Email Notification Rule
    • Name the rule: SLM Resolution Notification Rule
    • Trigger: On Linked Item Update: Ticket/Work Target: Work Target
    • Criteria: Generic Linking, Condition of Any, Ticket/Work Target: Work Target – Add New Condition of Notification Field changed from equal to “blank check” to equal to “checked”. Add New Condition of Target Type equal to ResolutionTime
    • Actions: Send email to Assignees with Email Template of SLM Resolution Notification, Importance of Normal, check Primary email
  • Create a new Business Rule, of type Email Notification Rule
    • Name the rule: SLM Response Failure Rule
    • Trigger: On Linked Item Update: Ticket/Work Target: Work Target
    • Criteria: Generic Linking, Condition of Any, Ticket/Work Target: Work Target – Add New Condition of State Field changed from Pending to Breached. Add new condition of Target Type equal to ResponseTime
    • Actions: Send email to Assignees with Email Template of SLM Response Failure, Importance of Normal, check Primary email
  • Create a new Business Rule, of type Email Notification Rule
    • Name the rule: SLM Resolution Failure Rule
    • Trigger: On Linked Item Update: Ticket/Work Target: Work Target
    • Criteria: Generic Linking, Condition of Any, Ticket/Work Target: Work Target – Add New Condition of State Field changed from Pending to Breached. Add New Condition of Target Type equal to ResolutionTime
    • Actions: Send email to Assignees with Email Template of SLM Resolution Notification, Importance of Normal, check Primary email

Save Rule. Save and Publish Workspace. Test out the work by saving a new ticket with all priorities. Observe if the Target Date is being populated in the Link Control.

 

CAVEATS

BMC FootPrints version 12.1.05 has a known defect that breaks the work target criteria of Elapsed Time % and Notification Threshold. Therefore, the warning notifications cannot be performed. If notifications for warnings are necessary, remain in version 12.1.04.001 or earlier until the know defect is corrected by BMC.

 

SEQUENCING SUBTASKS ON STATIC PROCESSES IN FPSC V.12

Posted by on Mar 14, 2017 in FPSC | Comments Off on SEQUENCING SUBTASKS ON STATIC PROCESSES IN FPSC V.12

BY STUART WHITE, RIGHTSTAR

Create a subtask process that will allow for tasks to be sequenced in a specific order. This is a static process that mimics the OOTB subtask sequencing found natively in FPSC v.11. There are three stages of subtasks: the first stage is a single subtask, the second stage consists of two subtasks, the third stage is a single subtask. Each stage may be edited only in sequence while other stages will remain in an Inactive status and inability to edit by any user. As each stage is resolved, the next sequential stage of tickets will change to a status of Open. Once all subtasks are resolved, the master ticket is resolved.

Applicability

FootPrints Service Core version 12.x running on Microsoft Windows Server 2008/2012.

Prerequisites

  • Administrator access to FPSC v.12.
  • A complete workspace container with a ticket item.
  • Assumption that the following fields exist, with the minimal choices, on the ticket item.
    • Status (Single Select; Choices – Open, Inactive, In-Progress, Pending, On-Hold, Resolved, Closed)
    • Impact (Single Select; Choices – Low, Medium, High)
    • Category (Single Select; Choices – New Hire)
    • Subcategory (Single Select; Choices – Full Time)
    • Template Name (Simple Text with hidden permission)
    • Urgency (Single Select; Choices – Low, Medium, High)
    • Assignee
    • Priority
    • Short Description
    • Subtask Sequence Complete (Boolean with hidden permission)
    • Subtask Sequencing (Integer with hidden permission)
    • Description
    • First Name (Simple Text)
    • Last Name (Simple Text)
    • User ID (Simple Text)
    • Department (Simple Text)
    • Email Address (Simple Text; Validated as Email)

 

BACKGROUND

FootPrints Service Core version 12 does not have the built-in subtask sequencing capability that exists in FootPrints Service Core version 11. An administrator of FootPrints Service Core version 11 can setup a static process with sequenced subtasks for workflow processing while Administrators and agent users can sequence subtasks on the fly. This document will explain how to build a static subtask sequence as an Administrator in FootPrints Service Core version 12.

This will outline the process necessary to replicate static subtask sequencing for a three-stage sequence process that utilizes four quick templates.

 

THE SOLUTION

The build items consist of:

  • Master/Subtask relationship
  • Fields with “Hidden” permissions
  • Addition of “Inactive” added to the Status field
  • Placement of “Hidden” fields on agent and customer web forms
  • Quick Templates and linking
  • Workflow Process
  • Business rules
  • Role settings

 

Master/Subtask relationship

The relationship is built with the Link Type of Master/Subtask. The containers and items will be set to the same container and item in this example.

Figure1_Page3

 

Fields with “Hidden” permissions

  • The “Subtask Sequence Complete” field is a Boolean field that is set with “Hidden” permissions
  • The “Subtask Sequencing” field is an Integer field that is set with “Hidden” permissions
  • The “Template Name” field is a simple text field that is set with “Hidden” permissions

Figure2_Page4

Figure3_Page4

 

Figure4_Page4

 

Addition of “Inactive” added to the Status field

  • Add a choice of “Inactive” to the status field

 

Placement of “Hidden” fields on agent and customer web forms

The placement of the “Hidden” fields is preference. The fields are typically placed at the bottom of the last section in a form. Fields will be added to both the agent web and customer web forms.

Figure5_Page5

 

Quick Templates and linking

Four templates are used for this sequence process; New Hire, Create an AD Account, Create an active badge, Provide a mobile phone, Provide a computer. The templates are built with all required field values, Template Name field value, Subtask Sequence field value, assignment value. The “New Hire” will serve as the master template. Other templates will be linked to the “New Hire” template with the “Master/Subtask:Subtask” relationship.

  • “New Hire” will be selected for use on the Agent Web and Customer Web forms. The “Name” field of the quick template will be “New Hire”. In the “Field Values” section, click “Add” for all necessary fields. The “Status” field will be set to “Open” as this will be used as the master task. Sample fields are:
    • Status with value of “Open”
    • Impact with value of Low
    • Category with value of “New Hire”
    • Subcategory with value of Full Time
    • Template Name with value of “New Hire”– This is a “Hidden” field that will be used as criteria for actions to occur.
    • Urgency with value of “I can still work”
    • Assignee with value of creator’s team or creator
    • Priority with value of “Low”
    • Short Description with value of “New Hire”
    • Subtask Sequence Complete with value of false
    • Subtask Sequencing with value of 0 (zero)
    • Description with value of “New Hire”

 

  • “Create an AD Account” will not be used with any form but only from the “New Hire” master ticket. The “Name” field of the quick template will be “Create an AD Account”. In the “Field Values” section, click “Add” for all necessary fields. The “Status” field will be set to “Open” as this will be the first subtask.
    • Status with value of “Open”
    • Impact with no value and the Inherit box selected
    • Category with no value and the Inherit box selected
    • Subcategory with no value and the Inherit box selected
    • Template Name with value of “Create an AD Account” – This is a “Hidden” field that will be used as criteria for actions to occur.
    • Urgency with no value and the Inherit box selected
    • Assignee with value of the responsible team
    • Priority with no value and the Inherit box selected
    • Short Description with value of “Create an AD Account”
    • Subtask Sequence Complete with value of false
    • Subtask Sequencing with value of 1 (one)
    • Description with value of “Create an AD Account”
    • First Name with no value and the Inherit box selected
    • Last Name with no value and the Inherit box selected
    • User ID with no value and the Inherit box selected
    • Department with no value and the Inherit box selected
    • Email Address with no value and the Inherit box selected

 

  • “Create an active badge” will not be used with any form but only from the “New Hire” master ticket. The “Name” field of the quick template will be “Create an active badge”. In the “Field Values” section, click “Add” for all necessary fields. The “Status” field will be set to “Inactive” as this will be the second sequence of subtasks.
    • Status with value of “Inactive”
    • Impact with no value and the Inherit box selected
    • Category with no value and the Inherit box selected
    • Subcategory with no value and the Inherit box selected
    • Template Name with value of “Create an active badge” – This is a “Hidden” field that will be used as criteria for actions to occur.
    • Urgency with no value and the Inherit box selected
    • Assignee with value of the responsible team
    • Priority with no value and the Inherit box selected
    • Short Description with value of “Create an active badge”
    • Subtask Sequence Complete with value of false
    • Subtask Sequencing with value of 2 (two)
    • Description with value of “Create an active badge”
    • First Name with no value and the Inherit box selected
    • Last Name with no value and the Inherit box selected
    • User ID with no value and the Inherit box selected
    • Department with no value and the Inherit box selected
    • Email Address with no value and the Inherit box selected

 

  • “Provide a mobile phone” will not be used with any form but only from the “New Hire” master ticket. The “Name” field of the quick template will be “Provide a mobile phone”. In the “Field Values” section, click “Add” for all necessary fields. The “Status” field will be set to “Inactive” as this will be the second sequence of subtasks.
    • Status with value of “Inactive”
    • Impact with no value and the Inherit box selected
    • Category with no value and the Inherit box selected
    • Subcategory with no value and the Inherit box selected
    • Template Name with value of “Provide a mobile phone” – This is a “Hidden” field that will be used as criteria for actions to occur.
    • Urgency with no value and the Inherit box selected
    • Assignee with value of the responsible team
    • Priority with no value and the Inherit box selected
    • Short Description with value of “Provide a mobile phone”
    • Subtask Sequence Complete with value of false
    • Subtask Sequencing with value of 2 (two)
    • Description with value of “Provide a mobile phone”
    • First Name with no value and the Inherit box selected
    • Last Name with no value and the Inherit box selected
    • User ID with no value and the Inherit box selected
    • Department with no value and the Inherit box selected
    • Email Address with no value and the Inherit box selected

 

  • “Provide a computer” will not be used with any form but only from the “New Hire” master ticket. The “Name” field of the quick template will be “Provide a computer”. In the “Field Values” section, click “Add” for all necessary fields. The “Status” field will be set to “Inactive” as this will be the third sequence of subtasks.
    • Status with value of “Inactive”
    • Impact with no value and the Inherit box selected
    • Category with no value and the Inherit box selected
    • Subcategory with no value and the Inherit box selected
    • Template Name with value of “Provide a computer”– This is a “Hidden” field that will be used as criteria for actions to occur.
    • Urgency with no value and the Inherit box selected
    • Assignee with value of the responsible team
    • Priority with no value and the Inherit box selected
    • Short Description with value of “Provide a computer”
    • Subtask Sequence Complete with value of false
    • Subtask Sequencing with value of 3 (three)
    • Description with value of “Provide a computer”
    • First Name with no value and the Inherit box selected
    • Last Name with no value and the Inherit box selected
    • User ID with no value and the Inherit box selected
    • Department with no value and the Inherit box selected
    • Email Address with no value and the Inherit box selected

 

  • Quick Template Linking the subtasks to the “New Hire” master task
    • Select the “New Hire” template and “Edit”
    • Select the “Linked Quick Templates” section
    • Select “Add Link”
    • Select the “Link Type” of Master/Subtask:Subtask
    • Select the “Quick Template” of “Create an AD Account”
    • Select Add
    • Repeat the quick template linking for each subtask of “Create an active badge”, Provide a mobile phone”, “Provide a computer”

 

Workflow Process

A basic workflow is created from the state field of status with no defining criteria in this example. The effect of this workflow is to assist with the control of the status selection when a new ticket is created. A new ticket may be created by any user in the “Open” status but not in an “Inactive” status. A ticket will only be created in “Inactive” status by a subtask used in this process. Additional control of creating and editing tickets in the “Open” and “Inactive” status is performed through role permissions.

  • Creating the workflow
    • From the Workflow Process section, select “New Workflow Process”
    • Select the Workflow State field of status
    • Select the status fields in the order of; Open, Inactive, In-Progress, Pending, On-Hold, Resolved, Closed
    • Select Create Workflow Process
    • Transition lines will be drawn as follows
      • Start to Inactive
      • Start to Open
      • Start to In-Progress
      • Inactive to Open
      • Open to Resolved
      • Open to In-Progress
      • In-Progress to Resolved
      • In-Progress to On-Hold
      • In-Progress to Pending
      • Pending to In-Progress
      • On-Hold to In-Progress
      • Resolved to Closed
    • Name the workflow “Service Request Workflow”
    • Select Save

  

Business Rules

There are eight business rules that mimic this three-stage subtask sequencing. A subtask sequence process that is more than three stages will require additional business rules. These business rules provide for a three-stage static sequence only.

  • Complete Sequence 1 (On Screen)
    • From the Business Rule section, select New Business Rule and then select On Screen rule
    • Name the rule “Complete Sequence 1”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Screen : On Update
    • There are three criteria: Subtask Sequence Complete equal to false, Status equal to Resolved, Subtask Sequencing equal to 1
    • The action is Set field value of Subtask Sequence Complete to true

Figure6_Page9

 

  • Set the Master Sequence to 1 (After Save)
    • From the Business Rule section, select New Business Rule and then select After Save rule
    • Name the rule “Set the Master Sequence to 1”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Linked Item Update : Master/Subtask:Subtask
    • The criteria is built on Generic Linking of Master/Subtask:Subtask and contains three supporting criteria: Subtask Sequencing equal to 1, Status equal to Resolved, Subtask Sequence Complete equal to true
    • There are two actions: Set field value of Status to In-Progress, Set field value of Subtask Sequencing to 1

Set the Master Sequencing to 1

 

  • Update the Sequence 2 subtasks status to Open
    • From the Business Rule section, select New Business Rule and then select After Save rule
    • Name the rule “Update the Sequence 2 subtasks status to Open”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Linked Item Update : Master/Subtask:Master
    • The criteria is built on Any Generic Linking of Master/Subtask:Master with supporting criteria of Subtask Sequencing equal to 1. One additional criteria not included in the Generic Linking is Subtask Sequencing equal to 2. One final criteria not included in the Generic Linking is Subtask Sequence Complete equal to false
    • The action is Set field value of Status to Open

Figure8_Page10

 

  • Complete Sequence 2 (On Screen)
    • From the Business Rule section, select New Business Rule and then select On Screen rule
    • Name the rule “Complete Sequence 2”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Screen : On Update
    • There are three criteria: Subtask Sequence Complete equal to false, Status equal to Resolved, Subtask Sequencing equal to 2
    • The action is Set field value of Subtask Sequence Complete to true

Figure9_Page10

 

  • Set the Master Sequence to 2 (After Save)
    • From the Business Rule section, select New Business Rule and then select After Save rule
    • Name the rule “Set the Master Sequence to 2”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Linked Item Update : Master/Subtask:Subtask
    • The criteria is built on Any Generic Linking of Master/Subtask:Subtask and contains four supporting criteria: Subtask Sequencing equal to 2, Status equal to Resolved, Subtask Sequence Complete equal to true, Template Name equal to “Create an active badge”. One additional criteria is built on Any Generic Linking of Master/Subtask:Subtask and contains four supporting criteria: Subtask Sequencing equal to 2, Status equal to Resolved, Subtask Sequence Complete equal to true, Template Name equal to “Provide a mobile phone”
    • The action is Set field value of Subtask Sequencing to 2

Figure10_Page11

 

  • Update the Sequence 3 subtasks status to Open
    • From the Business Rule section, select New Business Rule and then select After Save rule
    • Name the rule “Update the Sequence 3 subtasks status to Open”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Linked Item Update : Master/Subtask:Master
    • The criteria is built on Any Generic Linking of Master/Subtask:Master with supporting criteria of Subtask Sequencing equal to 2. One additional criteria not included in the Generic Linking is Subtask Sequencing equal to 3. One final criteria not included in the Generic Linking is Subtask Sequence Complete equal to false
    • The action is Set field value of Status to Open

Figure11_Page11

 

  • Complete Sequence 3 (On Screen)
    • From the Business Rule section, select New Business Rule and then select On Screen rule
    • Name the rule “Complete Sequence 3”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Screen : On Update
    • There are three criteria: Subtask Sequence Complete equal to false, Status equal to Resolved, Subtask Sequencing equal to 3
    • The action is Set field value of Subtask Sequence Complete to true

Figure12_Page12

 

  • Resolve the master on resolution of all subtasks (After Save)
    • From the Business Rule section, select New Business Rule and then select After Save rule
    • Name the rule “Resolve the master on resolution of all subtasks”
    • The state is Active
    • The business rule schedule is “Run Any Time”
    • The trigger is set to On Linked Item Update : Master/Subtask:Subtask
    • The criteria is built on every Generic Linking of Master/Subtask:Subtask with supporting criteria of Status equal to Resolved
    • The action is Set field value of Status to Resolved

Figure13_Page12

 

Role Settings

Existing roles will be edited for this purpose. The roles to focus on are for the Agent and the Customer Request Read/Submit/Edit. The roles are edited to allow or disallow permissions for viewing, editing, field permissions, and workflow permissions. Roles are located on the Administration tab under User Management. Select Roles and locate the agent and customer roles in the Service Request container. System roles will not be changed for this exercise.

  • Agent Role
    • Edit the agent role and select the Service Request item on the Role Information section
    • Select the Item Permissions section
      • Expand Service Request
      • Expand Viewing and select Yes at the top level and Yes on the Item Name for All
      • Expand Workflow Name for Service Request Workflow and validate that all status has Yes selected
      • Create will be set to Yes
      • Expand Edit Item and select Yes at the top level and Yes on the Item Name for All
      • Expand Workflow Name for Service Request Workflow and select No for the states of Inactive and Closed. All other states are set to Yes
    • Select the Field Permissions section and validate that all fields are set to Edit with the following exceptions that will remain View: Created On, Created By, Updated On, Updated By, Service Request Number. Specifically, the fields of Subtask Sequence Complete, Subtask Sequencing, and Template Name will be set to edit as these fields are affected by a business rule
    • Select the Workflow Permissions section and expand Service Request and Service Request Workflow. Validate that all Access is set to Yes with exceptions. Those exceptions are Resolved to Closed and Start to Inactive which are set to No
  • Customer Request Read/Submit/Edit
    • Edit the agent role and select the Service Request item on the Role Information section
    • Select the Item Permissions section
      • Expand Service Request
      • Expand Viewing and select Yes at the top level and appropriate viewing permissions
      • Expand Workflow Name for Service Request Workflow and validate that all status has Yes selected
      • Create will be set to Yes
      • Expand Edit Item and select Yes at the top level and appropriate editing permissions
      • Expand Workflow Name for Service Request Workflow and select No for the state of Closed. All other states are set to Yes
    • Select the Field Permissions section and validate that necessary fields are set to Edit. Specifically, the fields of Subtask Sequence Complete, Subtask Sequencing, and Template Name will be set to edit as these fields are affected by a business rule

Select the Workflow Permissions section and expand Service Request and Service Request Workflow. Validate that Access is set to Yes for Start to In-Progress

 

CAVEATS

When the New Hire ticket is created, there are four subtasks created. As each stage is Resolved, the next stage of subtasks is set to the Open status. These subtasks will remain as unable to edit until the logged in user refreshed the web page or performs a logout and login.

Creating searches that automatically adapt to the user who runs them

Posted by on Jun 9, 2015 in FPSC | 0 comments

Goal

Create saved searches that give the correct results no matter which agent runs them such as “Submitted by Me” and “My Overdue Assignments“. This is a sample application of the JavaScript injection technique taught in this previous post.

Applicability

FootPrints Service Core version 11 (any sub-release) running on Microsoft Windows Server 2003/2008/2012.

Prerequisites

  • Access to IIS on FootPrints application server
  • Access to the FootPrints file folder on the application server
  • URL Rewrite extension for IIS

Background

FootPrints Service Core version 11 has a limited number of built-in searches that dynamically apply the current user’s identity when they run. For example, all agents have access to the “My Assignments” saved search that gives each agent their respective assignments even though there is only one copy of this search. Searches like this behave as though there were an inherent “me” parameter in the assignment condition that gets filled in at runtime. There is no way to create your own searches with this capability. If you want all agents to have access to a search that shows their overdue assignments or any other custom-defined criteria, you have to create a separate search for each and every agent! As another example, you can’t create and roll out a “Submitted by Me” search to all agents; you actually have to create a “Submitted by Bob” search, a “Submitted by Jane” search, and so forth.

I was happy to see that version 12 provides a @Me placeholder you can use in the “assigned to” and “created by” conditions of a custom saved search. (For you version 12 stakeholders out there, a similar idea has been proposed on the BMC Community forum to support a @MyTeams placeholder.)  Version 11, however, requires a custom solution which I will put forth here.  

The Solution

First, you will create an advanced search and save it as “Shared (Internal)” so that other agents will be able to access it. You can define any complex criteria you need but remember to leave either the Assignee or Submitter field alone depending on which one you want to have populated at runtime when an agent runs the search.

So now you have your search, but because it has no constraint on the assignee or submitter field, it is not very useful. In order to have this constraint added at runtime, you’ll need to inject JavaScript onto the homepage for all agents. The technique I use for this is to use an URL Rewrite rule in IIS to load a custom JavaScript source file called GlobalJavascript.js. This source file will be loaded on every page in the FootPrints interface and you can put any code in it that you want. Details for this technique are offered here: Tutorial: Customizing FootPrints Service Core using JavaScript, Part 2. Assuming you aren’t already using that technique to push custom JavaScript out to the general FootPrints interface, you can create the GlobalJavaScript.js file using the code below. Otherwise, just take the parameterizedSearches function and the line that calls it from the code below and merge them into your existing file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
// DO NOT CHANGE THIS BLOCK
    var head = document.getElementsByTagName('head')[0];
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = '/tmp/javascript/ResizeDocumenT.js';
    head.appendChild(script);
    function AddWindowResizeEvent() {
        setTimeout(function() { 
            AddWindowResizeEvent(arguments);
        }, 100);        
    }
// END "DO NOT CHANGE THIS BLOCK"
}
 
parameterizedSearches();
 
function parameterizedSearches() {
    // only run this customization on the homepage.
    if (document.location.pathname.search('/MRcgi/MRhomepage.pl') == -1) {
        return;
    }
    // INSTRUCTIONS:
    // Populate the "searchesToParameterize" list with the searches that should take a parameter 
    // at runtime for either the assignee or submitter condition. 
    // The ids for searches can be found in \etc\SearchList. 
    // The id for cross-workspace searches can be found in \etc\crossProjectSearches\SearchList*.txt 
    var searchesToParameterize = [ 
        { 
            searchId: '1:PROJECT:SEARCH:Open__bassigned__bto__bme', 
            parameter: 'assignee' 
        },
        { 
            searchId: '1:PROJECT:SEARCH:Created__bby__bMe__blast__bmonth', 
            parameter: 'submitter' 
        }
    ]; 
 
    var mapParam = { 
        submitter: 'ORIGINATOR', 
        assignee: 'ASSIGNEDTO' 
    }; 
 
    if (document.dropDown != undefined && document.dropDown.SAVEDNAME != undefined) { 
        originalProcessDisplayDropdown = processDisplayDropdown; 
 
        processDisplayDropdown = function(refresh, useMaxMinInc, isMobile) { 
 
            var form = document.dropDown; 
 
            var selectedSearch = form.SAVEDNAME.value; 
 
            // See if the selected search matches any that should be parametrized 
            var parametrizedSearch = null; 
            for (var i = 0; i < searchesToParameterize.length; i++) { 
                var id = searchesToParameterize[i].searchId; 
                // cross-workspace searches do not begin with number 
                if (id.match(/^\d/) == null) { 
                    id = "CROSSPROJ:" + id; 
                } 
                if (selectedSearch.indexOf(id) == 0) { 
                    parametrizedSearch = searchesToParameterize[i]; 
                    break 
                } 
            } 
 
            if (parametrizedSearch !== null) { 
                var input = document.createElement('input'); 
                input.type = 'hidden'; 
                input.name = mapParam[parametrizedSearch.parameter]; 
                input.value = form.USER.value; 
                form.appendChild(input); 
            } 
 
            originalProcessDisplayDropdown(refresh, useMaxMinInc, isMobile); 
        }; 
    } 
}

At line 28, I have configured this customization to run with 2 saved searches. You need to replace this code so that it lists your own search(es). Each search is listed as an object (within { } braces) having a searchId property and a parameter property. To find the searchId property for your saved search, you’ll have to open the \etc\SearchList file under the main FootPrints folder on your server. This file is a bit difficult to read, so here are some tips: Each line of the file represents a saved search or report. Each line contains 4 tokens (pieces of data) separated by colons. The first token is the ID of the workspace to which the search/report belongs. The second token is the owner — the term “PROJECT” indicates that the search/report is shared for agents to access.  The next token should read “SEARCH” for searches, “FORMAT” for reports, or “TIME” for time tracking reports, and the final token is the search’s name with spaces and other characters encoded as ‘__b’, etc.

The parameter property should be either 'assignee' or 'submitter' depending on which field you want to provide dynamically using the id of the agent running the search.

You can add as many of these objects as you want, but remember to separate them with commas. Here’s what that area of code would look like if you only wanted to include 1 search:

var searchesToParameterize = [ 
    { 
        searchId: '1:PROJECT:SEARCH:Open__bassigned__bto__bme', 
        parameter: 'assignee' 
    }
];

and here’s what it would look like if you had 3 searches:

var searchesToParameterize = [ 
    { 
        searchId: '1:PROJECT:SEARCH:Open__bassigned__bto__bme', 
        parameter: 'assignee' 
    },
    { 
        searchId: '1:PROJECT:SEARCH:Created__bby__bMe__blast__bmonth', 
        parameter: 'submitter' 
    },
    { 
        searchId: '1:PROJECT:SEARCH:My__bOverdue__bTickets', 
        parameter: 'assignee' 
    }
];

Caveats

Once you’ve created a saved search and set up the JavaScript file and the URL Rewrite rule that sends the JavaScript to the agents’ web browsers,  you can tell your agents to include the search(es) on their homepages by changing their Preferences. To run the search, the agents would simply select the search from the list on their homepage as they normally would:

saved search There are a few caveats to be aware of, however:

  • This customization is desiged to work for agents only, not customers.
  • The runtime substitution of the agent’s ID into the search only takes place when the search is run by selecting it from the list on the homepage. If an agent has the search set as their default search, the custom behavior won’t take place when the agent first logs in or clicks the Home button.
  • The custom behavior will not occur if one of the searches is launched from the My Searches page (although the user can get the correct behavior by clicking the refresh icon after the search comes back with its results.)
  • With the code provided above, only the assignee and submitter fields can be supplied at runtime. Adding support for any arbitrary field is possible but beyond the scope of this sample.

Need help?

For help writing a FootPrints Service Core customization, or to discuss a project that might require a custom solution, contact RightStar Technical Services.

Disclaimer

In no event shall RightStar Systems, Inc. or its employees be held responsible for loss or damages arising out of the use, inability to use, or the results of use of, the information and source code contained in this article. The information and materials contained or referred to in this article are for reference only. RightStar Systems, Inc. and its employees make no warranty of any kind regarding the information and source code in this article. In no event shall RightStar Systems, Inc. or its employees be obligated to provide additional support on the topic discussed in this article.

 

Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Hide Buttons