CA Service Management

Expand all | Collapse all

Stored Query based on mins

Johnny_2302

Johnny_2302Jun 09, 2016 03:41 AM

Johnny_2302

Johnny_2302Jun 09, 2016 08:04 AM

Johnny_2302

Johnny_2302Jun 28, 2016 02:05 AM

  • 1.  Stored Query based on mins

    Posted Jun 09, 2016 03:38 AM


    Hi Team,

     

    We have a requirement wherein if the tickets are not acknowledge within 15 mins after creating them, then the same should be displayed in a bin on the scoreboard. I'm trying to write a stored query for the same, however unable to understand how to incorporate the 15 min parameter.

    Can some1 please suggest how can we achieve this?



  • 2.  Re: Stored Query based on mins

    Posted Jun 09, 2016 03:41 AM


  • 3.  Re: Stored Query based on mins

    Posted Jun 09, 2016 05:15 AM

    HI,

    You manage time for stored queries by using timespans.

    You create timespans from the admin\servicedesk\application data Codes\timespans

    Click on help for this window for more information on how to setup

    Hope this help

    /J



  • 4.  Re: Stored Query based on mins

    Posted Jun 09, 2016 05:42 AM

    Hi Jerome,

     

    I have already created timespan for 15 min interval in the below format, I need to use this timespan in the stored query. I'm unable to understand how to incorporate this in store query.

    The stored query I'm using is as below:

     

    (group.[group]group_list.member IN (@cnt.id)) AND active = 1 AND type = \'R\' AND status=\'OP\' AND zfmdpc = 400001 AND open_date > StartAtTime(\'PAST15MINS\')

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+0-15
    End Time
    Year   Month   Day   Hour   Minute  
    +0+0+0+0+0
    Trigger Time
    Year   Month   Day   Hour   Minute  
    +0+0+0+0+10


  • 5.  Re: Stored Query based on mins
    Best Answer

    Posted Jun 09, 2016 06:33 AM

    If I understand correctly you want to display all ticket that have not be ack for more that 15 mn.

    your timespans will return now -15mn in unixtimestamp and compare to it to open_date in unixtimestamp

     

    then let's assume now:

    now is  2016/06/09 08:15:00 converted unixtime = 1465460100

    open_date is  2016/06/09 07:45 converted unixtime = 1465458300

    15 duration in converted unixtime= 900

    then your PAST15MINS (at the time of the evaluation) is 1465460100 - 900 = 1465459200

     

    as you can see the number returned for the open_date is inferior to the past15MIN

     

    so your comparaison if you want to return tixket that have past those 15 mn must be:

     

    (group.[group]group_list.member IN (@cnt.id)) AND active = 1 AND type = \'R\' AND status=\'OP\' AND zfmdpc = 400001 AND open_date < StartAtTime(\'PAST15MINS\')

     

    Hope this help

    /J



  • 6.  Re: Stored Query based on mins

    Posted Jun 09, 2016 08:04 AM

    Thanks jerome.. This seems to be working fine!



  • 7.  Re: Stored Query based on mins

    Posted Jun 09, 2016 08:10 AM

    You welcome!

    I hope the explanation can help others too when looking on how timespans are evaluated. as I need to agree that this may be a little confusing.and have to look twice prior to get there.

    If fixed please mark as correct answer so others can benefits,

    /J



  • 8.  Re: Stored Query based on mins

    Posted Jun 10, 2016 03:22 AM

    Hi Jerome,

     

    I'm stuck again with similar issue, I need to display the tickets in a new bin whose SLA will be violated in an hour. Below is what I have done:

     

    Stored Query:

    (group.[group]group_list.member IN (@cnt.id)) AND active = 1 AND type = \'R\' AND zfmdpc = 400001 AND attached_slas.time_to_violation < EndAtTime(\'NEXT_HOUR\') AND (priority IN (6,7,8,9,10,11))

     

    Timespan:

     

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+0+0

     

    End Time

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+1+0

     

    Trigger Time

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+1+0

     

     

    Can you please check and let me know if this is right?



  • 9.  Re: Stored Query based on mins

    Posted Jun 10, 2016 07:49 AM

    group.[group]group_list.member IN (@cnt.id)) AND active = 1 AND type = \'R\' AND zfmdpc = 400001 AND attached_slas.time_to_violation < StartAtTime(\'NEXT_HOUR\') AND (priority IN (6,7,8,9,10,11))

     

    Evaluate every 30mn  for the datetimestamp 60 mn after the trigger time

    /J



  • 10.  Re: Stored Query based on mins

    Posted Jun 14, 2016 01:59 AM

    Hi Jerome,

     

    I tried it and its not working, the concept is not yet clear..is there any documentation for this(i went thru the CA docs but failed to understand). I raised a ticket and its projected violation time is

    06/14/2016 01:21 pm

    and current time is 11:26 pm, so as per below stored query it should display the ticket in the new bin, right?

     

    (group.[group]group_list.member IN (@cnt.id)) AND active = 1 AND type = \'R\' AND zfmdpc = 400001 AND attached_slas.time_to_violation < StartAtTime(\'ONE_HOUR\') AND (priority IN (6,7,8,9,10,11))

     

    i have changed the start time to 2 hours and trigger time to 30 mins

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+2+0
    End Time
    Year   Month   Day   Hour   Minute  
    +0+0+0+0+0
    Trigger Time
    Year   Month   Day   Hour   Minute  
    +0+0+0+0+30


  • 11.  Re: Stored Query based on mins

    Posted Jun 20, 2016 07:21 AM

    Hi Jerome,

     

    Can you please help, m still facing the issue. The requirement is to show the tickets in a new node 1 hour before the violation of the ticket. eg. if the tickets violation time is 2 hrs then post 1 hour of opening the ticket, this ticket should be viewable in the newly created bin



  • 12.  Re: Stored Query based on mins

    Posted Jun 20, 2016 08:13 AM

    Hi, the one provided is supposed to work.

    Also if your requirement is to show one hour before tvilation why did you change it to 2 hours

    Did you check the others part of your query that they evaluate true (like your priority as they don't look standard)

    Can you do a quick test by only use the timespans part in your query to eliminate potential other(s) false.

     

     

    attached_slas.time_to_violation < StartAtTime(\'ONE_HOUR\')

     

    Regards,

    /J

     

     



  • 13.  Re: Stored Query based on mins

    Posted Jun 27, 2016 08:33 AM

    Hi Jerome,

     

    Changing it to 2 hours was just for the testing purpose, I checked removing other parameters like priority and it seemed to bring in few tickets but it doesn't seem proper.

     

    As of now it has been configured as follows:

     

    Stored query:

    (group.[group]group_list.member IN (@cnt.id)) AND active = 1 AND type = \'R\' AND zfmdpc = 400001 AND attached_slas.time_to_violation < StartAtTime(\'ONE_HOUR\') AND (priority IN (12,13,14,46,47,48,49,51,52,53)) AND status!=\'RE\'

     

    Onehour Timespan

     

    Start Time

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+1+0

     

    End Time

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+0+0

     

    Trigger Time

     

    Year   Month   Day   Hour   Minute  
    +0+0+0+0+30

     

    As of now I can see below tickets in the bin,

     

    Ticket 1:

    Ticket 2:

     

    I haven't understood yet how the calculations are been done.  Can you please tell me what attached_slas.time_to_violation values is in above 2 tickets (does it take the projected violation time?) And as per requirement the ticket should be displayed in the bin One hour before the SLA violation.(Current time is 6:03pm IST).

     



  • 14.  Re: Stored Query based on mins

    Posted Jun 28, 2016 02:05 AM

    Guys any idea on the above issue?