CA Service Management

 View Only
  • 1.  SPEL to update impact by customized field-Calculate Priority

    Posted Aug 21, 2018 06:30 AM

    Hi,

     

    I'm trying to develop a spel to set the impact of a incident based on a customized field (SREL nr).

     

    For now I implemented the following spel:

    cr::z_service_impact(...)
    {
    string method;
    method = 'cr::z_service_impact';
    string imp;
    imp=z_affected_service.service_impact;
    logf(SIGNIFICANT,"%s METHOD - Service Impact %s", method, imp);
    if(!is_null(imp))
    {
    send_wait(0, this, "call_attr", "impact", "set_val", imp, "SURE_SET");
    logf(SIGNIFICANT,"%s IMPACT", impact);
    }
    }

     

    The .mod file

    OBJECT cr {
    TRIGGERS {
    POST_VALIDATE z_service_impact() 2300
    FILTER(EVENT("INSERT"));
    };
    };

     

    When create a new ticket it does not change the priority automatically updated based on priority matrix.

     

    Can anyone help on this? I've read that we can use calc_incident_priority() function in my spel, but I'm not getting there.



  • 2.  Re: SPEL to update impact by customized field

    Broadcom Employee
    Posted Sep 21, 2018 01:54 PM

    Does anyone in the CA Service Management community with expertise in SPEL Code have any advice for frteixeira?



  • 3.  Re: SPEL to update impact by customized field

    Posted Sep 24, 2018 02:06 AM

    From Your description it is unclear if priority calculation does not work, or impact value is not set.



  • 4.  Re: SPEL to update impact by customized field

    Posted Sep 29, 2018 06:27 PM

    Hi Gutis,

    The priority calculation does not work.

    I can set the impact value.



  • 5.  Re: SPEL to update impact by customized field-Calculate Priority

    Posted Oct 04, 2018 12:49 AM

    You can try to change POST_VALIDATE to PRE_VALIDATE



  • 6.  Re: SPEL to update impact by customized field-Calculate Priority

    Posted Oct 04, 2018 10:44 AM

    Hi Gutis,

     

    If I change to PRE_VALIDATE, then the new impact based on the CI is not defined.



  • 7.  Re: SPEL to update impact by customized field-Calculate Priority

    Posted Oct 16, 2018 08:27 AM

    Try to change POST_VALIDATE to POST_CI with sequence order high.

     

    The trigger below cause redefine impact value in cr object.

    POST_CI cr::pri_cal_actlog(persistent_id, man_urg, man_imp, auto_urg, auto_imp, init_urg, init_imp, type, tenant, last_mod_by, view_type) 240 FILTER(((EVENT("INSERT UPDATE") && ((type == "P") || (type == "I"))) && ((((impact {} || urgency {}) || affected_service {}) || customer {}) || category {})));