SLT – Process Targets: customize details table


Hi all, maybe you already know the SLT – Process Targets table related to Incidents, Changes and Requests, and you probably know that this table shows, in case a record is linked to a SLA, some useful info about SLT (or SLO) breaching.

Info showed inside this table are the SLT name, the agreement ID, the status of single SLT (achieved, breached, running, etc.), initial state, final state and expiration date time, all info are retrieved from the sloresponse table. In poor words, when loading the record detail form (eg. Incident page), system performs a search into sloresponse table and fill some rad variables ($L.slo.<name_field>) to show data into the form. Do you know that we can add some additional columns?

Let’s suppose we want to add the Total Time column because we want to allow operators to see, in addition to Expiration date/time, how much time is passed since the starting of the SLT calculation (I’m adding Total Time, but you can add any sloresponse field you prefer!)

As first step we have to modify the subform containing the table and add a new column; form is called sloresponse.active.vj.horz, it is the same for all objects (Incidents, Change and Requests), so we will modify it just once to have reflected our changes in all forms.

See image below to see how to cofigure new column (I’m assuming you already know how to update a form and how to add new columns to a table object):

fd_sloresponse.active.vj.horz

I called column header Total Time and I want to fill this column with the total.time field of sloresponse record, set columns as Read-Only and filled the input to $L.slo.total.time (please note that this is a RAD variable, I called it in that way just to remember which information it is containing).

Once performed changes to form, in order to manage our new variable set into the form ($L.slo.total.time), we have to modify 4 main objects:

  1. Script Library sloDisplay
  2. Display Screen imIncident.view (for Incidents)
  3. Display Screen change.view (for Changes)
  4. Display Screen rm.request.view (for Requests)

Open the Script Library sloDisplay and search for function getListSLOs. The sloDisplay script library is responsible for retrieving values from sloresponse record when an Incident (Change or Request) details form is displayed, so we have to add the code to get our new additional value for total.time field.

Find the following code and add the part highlighted in bold:

for ( i = 0; i < fldsNum; i++)
  {
    var field = fields[i];
    if ( field == "sla.id" )
      sloList[i][v] = sloResponse.agreement_id;
    if ( field == "slo.current.status" )
      sloList[i][v] = sloResponse.current_status;
    if ( field == "slo.name" )
      sloList[i][v] = sloResponse.slo_name;
    if ( field == "slo.initial.state" )
      sloList[i][v] = sloResponse.initial_state;
    if ( field == "slo.final.state" )
      sloList[i][v] = sloResponse.final_state;
    if ( field == "slo.expiration.time" )
      sloList[i][v] = sloResponse.expiration_time;
    if ( field == "slo.total.time" )
      sloList[i][v] = sloResponse.total_time;
  }

In this way we are “telling” the function to get the field list passed to this function (we will call this function inside Display Screen objects, so don’t worry, I’ll show you how to do in the next step) and, if inside fileds name there’s also slo.total.time, we have to store the total.time value of sloresponse record inside the sloList temporary variable.

Save and Compile the Script Library and let’s move to Display Screen objects – I will show you how to modify just imIncident.view Display Screen, the remaining display screens for Changes and Requests will be modified in the same way.

Open the imIncident.view Display Screen, move on Initialization Expressions panel and add the following code after the already existing code:

cleanup($L.sla.id);cleanup($L.slo.current.status);cleanup($L.slo.name)
cleanup($L.slo.initial.state);cleanup($L.slo.final.state)
cleanup($L.slo.expiration.time);cleanup($L.slo.total.time)
if (not  (null(agreement.ids in $L.filed))) then ($L.record.id.field=jscall("sloDisplay.getRecordIdField", filename($L.filed));$L.record.id=$L.record.id.field in $L.filed)
$L.qryFields={"sla.id", "slo.current.status", "slo.name", "slo.initial.state", "slo.final.state", "slo.expiration.time", "slo.total.time"}
$L.sloList=jscall("sloDisplay.getListSLOs", filename($L.filed), $L.record.id, agreement.ids in $L.filed, $L.qryFields)
$L.sla.id=1 in $L.sloList;$L.slo.current.status=2 in $L.sloList
$L.slo.name=3 in $L.sloList;$L.slo.initial.state=4 in $L.sloList
$L.slo.final.state=5 in $L.sloList;$L.slo.expiration.time=6 in $L.sloList
$L.slo.total.time=7 in $L.sloList

(this update must be done also inside change.view and rm.request.view display screen objects otherwise when opening details page of one of these objects, the Total Time column will be empty because not valorized)

Let’s see what we are doing… first of all we perform a cleanup of all variables to be sure we won’t have any bad or wrong data displayed, then we retrieve the record.id.field value from the slamodulecontrol table (this step refers to SLA configuration settings), then we define the list of fields we want to retrieve from sloresponse record (this fields list will be passed to function getListSLOs to specify which fields needto be retrieved – do you remember the code updated in the previous step?), then we call our function to get all data and finally, we relate datareturned by function to our RAD variabled (included our new variable $L.slo.total.time).

As results of our changes, when an operator will open an Incident details page, he/she will be able to see also the new column (please be sure tologout HPSM and login again to see cganges working correctly):

Total Time

Hope as always that this post will help you during your job 🙂

Bye

Please note: I noticed a strange issue on web interface, form is not updated and new column is not added as per win client, the problem seems to be related to subforms into subforms – I solved this issue by updating parent subforms (im.incident.subform.sla, rm.request.subform.sla and chm.change.subform.sla), just do a change on them and save to let system to “re-relate” children subforms 😉

Tagged with: , , , , , ,
Posted in HPSM
2 comments on “SLT – Process Targets: customize details table
  1. Niks says:

    I have not gone through all the topics but yes whatever i have gone through is what i had always been searching for ” BASICS” . Thanks a lot for sharing this valuable knowledge regarding HP SM. I will be reading remaining stuff as i found it quiet useful in customization and tailoring of HP SM.Its Great Thanks 🙂

Leave a comment

Support this blog

Hi, first of all thank you for visiting my blog!

As you probably already noticed, this blog is completely accessible and free, there's no restricted content and everybody can find info about HP Service Manager.

I spend most of my free time trying to do my best to help people in trouble with technical topics on HPSM (plus some more general articles). If you find my articles interesting, know that you can support my work by donating using the button below - this will encourage me to go ahead with new articles ;-)

Thanks in advance!

Donate Button with Credit Cards

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 40 other subscribers