CA Service Management

  • 1.  How to use macro to change priority when the ticket status change

    Posted Mar 09, 2016 08:51 PM

    Hi,

     

    I need to change priority when the ticket status change.

     

    I tried to do the following:

     

    In the "Activities Notification", In the activity "Change Status", I create an event.  This Event contain an Action Macro that change the ticket priority.

     

    Screen "Activities Notification": " Change Status"

     

     

    In the event,at the tab "Action Information" i added an action macro:

     

     

    In the event,at the tab "Information Configuration" i setting this

     

    :

    The macro added in the event, is this:

     

     

     

    I guess I did all right , but when I update the status of a ticket , the event is not triggered .. What did I do wrong ? Lack some other configuration ? Thank you,



  • 2.  Re: How to use macro to change priority when the ticket status change
    Best Answer

    Broadcom Employee
    Posted Mar 10, 2016 11:56 AM

    delay time 00:00:00 is not a good idea. Can you try give some delay time...like 00:00:30?



  • 3.  Re: How to use macro to change priority when the ticket status change

    Posted Mar 10, 2016 12:18 PM

    Hi Chi,

     

    Is there a best practice on how to use delay times?  I recently setup a few events to automatically change status and they're all set with 00:00:00 as the delay time.  I checked the wiki but couldn't find this information.



  • 4.  Re: How to use macro to change priority when the ticket status change

    Posted Mar 10, 2016 12:56 PM

    Hi Chi.

     

    REALLY. I changed the time as you are oriented and now it worked !! Good job!!!

     

    Thanks a lot for the help!

    Regards,

    Rafael



  • 5.  Re: How to use macro to change priority when the ticket status change

    Broadcom Employee
    Posted Mar 10, 2016 01:55 PM

    Rafael, I am glad that it worked for you. Thanks _Chi



  • 6.  Re: How to use macro to change priority when the ticket status change

    Posted Mar 10, 2016 03:20 PM

    Hi,

     

    I don't mean to thread jack, but I feel like my question applies here and would help users searching the communities in the future.

     

    Is there a defined best practice for how to use the delay time field??



  • 7.  Re: How to use macro to change priority when the ticket status change

    Broadcom Employee
    Posted Mar 10, 2016 04:35 PM

    Grant, I am not sure if there is some doc on "best practice" here. The reason for not setting 00:00:00 delay is to avoid

    some time race situation...like one thread does something

    before the other which should finishes first. I know this does

    not fully address this topic here but I just try to throw out my

    2-cents here. thanks _Chi



  • 8.  Re: How to use macro to change priority when the ticket status change

    Posted Mar 10, 2016 04:44 PM

    Thank you Chi, that's helpful information.



  • 9.  Re: How to use macro to change priority when the ticket status change

    Posted Mar 10, 2016 07:38 PM

    Personally I always set at least a 1 second delay, and add 2 seconds between any actions that affect the same record.  If you are firing multiple actions against the same record then I prefer to attach events rather than run macros directly.  Not sure you could call that 'best' practice, but it seems to keep me out of trouble most of the time.



  • 10.  Re: How to use macro to change priority when the ticket status change

    Posted Mar 13, 2016 03:39 AM

    Hi, i think you should stop setting attributes directly e.g. priority = 1, since this may cause unpredictable behaviour and this is probably cause why you need to play with execution times. I would suggest using send_wait to set attribute values e.g. update_object_super. I would also suggest not to use lock object option for the macro.

     

     

    uuid who;

    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");

    who=msg[0]; 

    if(is_null(priority))

    {

    send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, persistent_id, 0, "priority", 0);

        if (msg_error()) {

        logf(ERROR, "Set Priority on %s failed. Error: %s", ref_num, msg[0]);

        }

    }