How to Calculate the Age of an Incident and Report on these Values.

Version 2
    Share:|

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    Remedyforce Service Desk


    COMPONENT:

    Remedyforce Spring 12



    PROBLEM:

    Is there a way to show the age of an incident and group incidents based on age? IE: open 0-1 days, 2-5 days, 5-10 days, etc.


    SOLUTION:

     

    As a SalesForce administrator we have to add two new custom fields to the incident object. 

     

    The first field will calculate the number of days the incident has been, or was open.  The second field then writes text based on a series of nested if() statements. 

     

    Creating the Incident Age field: 

    1. Select Setup | App Setup | Create | Objects | Incident Object

    2. Select “Custom Fields & Relationships | Select New | Formula:

     
      Field name = “Days Openâ€� then Tab to populate Field Name

      Formula return type = Number with 0 decimal places

      Select Next

     
      In the "Simple Formula" tab copy and paste the below formula: 

     

    if( BMCServiceDesk__state__c = True,datevalue(now())-datevalue(CreatedDate), datevalue( BMCServiceDesk__closeDateTime__c) - datevalue(CreatedDate))

    3. Click Verify Syntax | Click Next.

    4. Accept defaults in Field Level Security, unless you need custom security, select Next

    5. In Custom fields, if you want to display this value in the SalesForce version of the incident accept defaults, else de-select this option to not add these values to the standard form.

    6. Click Save | Click New.

     

    Converting the Incident Age value into Days;

    7. In the new field dialog that resulted from the "Save and New" option above:

    8. Select Formula:

      Field name = “Grouped by Days Openâ€� then Tab to populate Field Name

      Formula return type = Text

      Select Next

     

      In Simple Formula tab copy and paste the below formula:

     

    if(Days_Open__c<=1,"0-1 Days",

     

    (if(Days_Open__c>1 && Days_Open__c<=5,"2-5 Days",

     

    (if(Days_Open__c>5 && Days_Open__c<=10,"5-10 Days",

     

    (if(Days_Open__c>10 && Days_Open__c<=30,"10-30 Days",

     

          "More than 30 Days")

     

    ))

     

    ))

     

    ))

     

    ** The above could be modified to use alternate values, or additional evaluation lines. 

     

    9. Click Verify Syntax | Click Next.

    10. Accept defaults in Field Level Security, unless you need custom security | Click Next.

    11. In Custom fields, if you want to display this value in the SalesForce version of the incident accept defaults, else de-select this option to not add these values to the standard form.

    12. Select Save.


    NOTE: Now that the data exists for each incident, we can create a report to show this data and group by the "Grouped by Days Open" Field.

     

    Create the Report to Shows Incidents grouped by Days:

    1. From SFDC Click Setup | Click + (All Tabs) | Click Reports | Click New Report

    2. In Quick Find | Click Incident | Click Incidents | Click Create.

    3. Drag and drop "Days open" and "Grouped by Days Open" onto report.

    4. Group by "Grouped by Days Open" column

    5. Add additional data of interest and run the report.

    6. Verify the report returns the Age and Days open as desired.

     


    Article Number:

    000007426


    Article Type:

    Solutions to a Product Problem



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles