System Admin and Configuration

Get Involved. Join the Conversation.

Topic

    Ruhul Sarker
    Is it possible to create Business Rule based on...Answered
    Topic posted December 5, 2017 by Ruhul SarkerGreen Ribbon: 100+ Points 
    216 Views, 4 Comments
    Title:
    Is it possible to create Business Rule based on Incident.Created date time field?
    Content:

    Hi,

    I want to create a business rule based on Incident Created (Date/Time) field. While added if condition on Incident.Created field, it only give me option to set rules based on Time Stamp value although it stored both date and time in database. But I want to set condition on Date and Time value (ex: equal to 05/12/2017 16:20).

    Would appreciate if anybody can help me on this.

    Thank you.

     

     

    Version:
    Service Cloud May 2016
    Image:

    Best Comment

    Gursimran Singh Saini

    Two ways to achieve this:

    Option 1. Create a new Custom Field to store Date/Time when Incident was created. Then use your Custom Field in IF Conditions.

    Option 2. Take Incident.Reference # in IF condition and match it as a Regular Expression.

    For example: Incident created on 4th December 2017 will have reference number 171204-xxxxxx. We just need to check first six digits. Here's the regex to check that:

    (?=^.{0}(1))(?=^.{1}(7))(?=^.{2}(1))(?=^.{3}(2))(?=^.{4}(0))(?=^.{5}(4))

    You can test this RegEx here: https://regex101.com/r/D06vqJ/1

     

    I'd go with Option 1. You can use Data Import wizard to update Incident Created Custom Field of old Incidents.

    Comment

     

    • Seeking Solution

      Hi Rahul,

      What you want to achieve by adding date to conditions, just wanted to understand so can suggest if any other way to make it work.

      Thanks

    • Gursimran Singh Saini

      Two ways to achieve this:

      Option 1. Create a new Custom Field to store Date/Time when Incident was created. Then use your Custom Field in IF Conditions.

      Option 2. Take Incident.Reference # in IF condition and match it as a Regular Expression.

      For example: Incident created on 4th December 2017 will have reference number 171204-xxxxxx. We just need to check first six digits. Here's the regex to check that:

      (?=^.{0}(1))(?=^.{1}(7))(?=^.{2}(1))(?=^.{3}(2))(?=^.{4}(0))(?=^.{5}(4))

      You can test this RegEx here: https://regex101.com/r/D06vqJ/1

       

      I'd go with Option 1. You can use Data Import wizard to update Incident Created Custom Field of old Incidents.

    • Ruhul Sarker

      Hi Saini,

      Thanks for your response and suggested solution. I thought about Option 1 but our team don't want to create more custom fields as we already have few. I am thinking to try your 2nd option.

      But its weird to consider only Time portion of Incident.Created field in Business Rule where originally it stores Date/Time value.

      Thank you.

       

      Hi Seeking Solution,

      Thanks for your reply. I want to send a different auto response to the user/ student for different date/time.

       

       

    • Gursimran Singh Saini

      Ruhul,

      Just to let you know, Date/Time Custom Fields take very little space. I think its about 4 bytes.

      However, Text Fields take 255 bytes of space. One should avoid creating too many Text Field Custom Fields.