CA Service Management

Expand all | Collapse all

Activity Notification For the Call_TYPE in CA SDM

Jump to Best Answer
  • 1.  Activity Notification For the Call_TYPE in CA SDM

    Posted 03-13-2018 09:20 AM
      |   view attached

    Hi Communities

     

    Sorry to Bother Everyone,

     

    I have issue, I created a Activity Notification for the CAll TYPE field for Incident/Requests, Build it with the same Code as the Activity Associations called Type.

     

    This is to send out a notification when we change the ticket manully from Incident to a request. We painted the type on the IN forms, so you can swap from incident to request and visa versa. I build a Notification Rule for it as well with a Condition to send out a mail when the call type change.

     

    Problem is i'm not getting any mails when I change the type. Nothing Fire no mail history of notification history.

     

    Please I need help please. AS this is a requirement from Business. In short there was no Activity Notification for TYPE. I had to create one. Am I doing something wrong.

     

    Regards

     

    Edgar Louw

    Attachment(s)



  • 2.  Re: Activity Notification For the Call_TYPE in CA SDM

    Broadcom Employee
    Posted 03-19-2018 11:58 AM

    Edgar.......

     

    Do you have any further questions regarding this thread?

     

    If not, please mark one of the provided answers as correct so that this thread can be closed.



  • 3.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-24-2018 09:42 AM

    Hi Edgar,

     

    So this isn't related to CR_TYPE? I don't want to keep cluttering up this thread. Can you message me instead?



  • 4.  Re: Activity Notification For the Call_TYPE in CA SDM

    Broadcom Employee
    Posted 03-14-2018 09:57 AM

    Hi Edgar,

    The knowledge article may help How to get audit logs for a custom column.

    Although it mentions a custom field, your field is ticket Type. Most likely you are missing triggers/mod file in step 11.

    Regards,

    Derek



  • 5.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 03-13-2018 02:34 PM

    Hi Edgar,

     

    I think you may have missed the Activity Notification.  The 'Type' activity notification you created isn't used when your change the type field.  You can however have it log a Field Update.

     

     

    • Go to the admin tree>Notifications>Activity Notifications
    • Find Field Update
    • Press the Update Notification Rules button and find your CRType rule for Request and Incident
    • Press Save
    • Test

     



  • 6.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-25-2018 04:45 AM

    Hi Derek

     

     

    Just notifingyou CRtype works as Grant suggested in the call. I used his Trigger and his Spel code he build. Thanks for this. helps alot.



  • 7.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-15-2018 04:33 AM

    Hi Derek

     

    Do you have maybe a document how to send a Notification from custom field, Audit, I got to work. It doesn't want to send out a mail when updating the field. when Use my custom Activity Association and Activity Notification it does nothing. Audit log part works. But still no mail

     

    Soon as add it to the Field update - Activity Notification, it send a mail when you updating every updateabe column. I even added a condition just to do the custom field no luck.

     

    Sorry for asking, been struggling a month now. Should be so hard to great a notification on a custom field.

     

     

    Regards

     

    Edgar Louw



  • 8.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 03-14-2018 10:00 AM

    HI Grant

     

    Will have look Grant thanks really.

     

    Regards



  • 9.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 03-14-2018 01:34 AM

    Hi Grant

     

    I did Make one sorry, didn't put it in the Attachement my fault.

     

    Activity Notification TYPE



  • 10.  Re: Activity Notification For the Call_TYPE in CA SDM

    Broadcom Employee
    Posted 05-24-2018 09:25 AM

    Hi Edgar,
    Check out this community discussion Activity Notification which has similar information sending email notification for custom field.

    Regards,

    Derek



  • 11.  Re: Activity Notification For the Call_TYPE in CA SDM
    Best Answer

    Posted 03-14-2018 09:55 AM

    Hi Edgar,

     

    I saw that you created the Activity Notification for Type.  The problem is there isn't any logic that automatically creates activity logs using custom activity notification types.  Your activity association is configured to use Field Update and you have Log Me checked.  So it should be generating Field Update activities which you can use to send your notification.



  • 12.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-15-2018 04:34 AM

    Hi Grant

     

    Do you have maybe a document how to send a Notification from custom field. I got the Audit, to work. It doesn't want to send out a mail when updating the field. when Use my custom Activity Association and Activity Notification it does nothing. Audit log part works. But still no mail.

     

    Soon as add it to the Field update - Activity Notification, it send a mail when you updating every updateabe column. I even added a condition just to do the custom field no luck.

     

    Sorry for asking, been struggling a month now. Should be so hard to great a notification on a custom field.

     

     

    Regards

     

    Edgar Louw



  • 13.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-24-2018 09:43 AM

    thanks Derek. Best place in the world with the best helpfull develpers. You all are verfy helpfull. I'm not the best spell coder. But trying to get better at this.

     

    THANKS for helping, really I'm so gratefull this communities is awesome. Anything you guys wan tme to help promote send i will for ne development.

     

    regard

    Edgar Louw



  • 14.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-15-2018 04:18 PM

    Hi Edgar,

     

    It's not a simple customization.  Here's how I would go about it, there may be cleaner approaches to this..

     

    High level steps:

    1. Spel trigger captures type changing

    2. Trigger calls spel script which creates event

    3. Event fires action that sends a multiple notification

    4. Multiple notification sends off email to recipients with attached message template

     

    Multiple Notification Macro:

    Symbol: zCR Type Change Notification

    Message Template: <link existing message template. Note the attributes are referenced without the object prefix. e.g., @{category.sym}. This only applies to multiple notifications>

    Object Contacts: <add assignee, requestor, or whoever else needs to be notified>

     

    Event:

    Name: zCR Type Change Event (event sym must be exact as it's hard coded into the script)

    Object Type: Request/Incident/Problem

    Work shift: <leave empty>

    Condition: <leave empty>

    Allow time resetting: Yes (allows spel script to update the delay time)

    On Done Event Flag: No History

    Action Information - On True:  zCR Type Change Notification (link previously created multiple notification)

     

    Trigger: zCR.mod (example name, use this or merge in an existing mod file)

    MODIFY cr     POST_VALIDATE z_cr_type_notification() 10050 FILTER(type{} && EVENT("UPDATE"));

    Spel file:

    cr::z_cr_type_notification(...) {
      object attached_events_table_record_notify, evt_group_leader_notify;
      string persid, event_sym_notify, evt_persid_notify, method;

      persid = persistent_id;
      method ="cr::z_cr_type_notification";
      logf(MILESTONE, "%s started", method);
     
      event_sym_notify = "zCR Type Change Event";
      //logf(MILESTONE, "Event symbol is %s", event_sym_notify);
      evt_persid_notify = (string)expand(format("&{'%s' = evt.sym->persistent_id}", event_sym_notify));

         
      send_wait(0, top_object(), "get_co_group");
      if (msg_error()) {
        logf(ERROR, "%s - %s", ref_num, msg[0]);
      }
     
      evt_group_leader_notify = msg[0];
      send_wait( 0, top_object(), "call_attr", "atev", "get_new_dob", NULL, NULL, evt_group_leader_notify);
     
      if (msg_error()) {
        logf(ERROR, "%s - %s", ref_num, msg[0]);
      }
     
      attached_events_table_record_notify = msg[0];
      attached_events_table_record_notify.obj_id = persistent_id;
      attached_events_table_record_notify.event_tmpl = evt_persid_notify;
      attached_events_table_record_notify.wait_time = 0;
      attached_events_table_record_notify.group_name = "zCRTypeChangeEventNotify";
      send_wait(0, evt_group_leader_notify, "checkin");
     
      if (msg_error()) {   
        logf(ERROR, "%s - %s", ref_num, msg[0]);
      }
      else {
        logf(MILESTONE, "Successfully Created Notify Event %s", attached_events_table_record_notify.persistent_id);
      }
      logf(MILESTONE, "%s ended", method);
    }


  • 15.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-16-2018 03:14 AM

    Thanks Grant will try this really thanks you.

     

    Sjoe, I knew it wouldn’t’ be easy. Really thanks you.

     

    Edgar Louw

    Secondary Technical Support

    Sanlam Group Technology and Information

     

     

     

    T +27 21 947 6483  C +27 83 784 8770

    edgar.louw@sanlam.co.za

    Sanlam Head Office, 2 Strand Road, Bellville, 7532

     

     



  • 16.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-16-2018 07:49 AM

    I don't know what I was thinking yesterday, this customization doesn't need to use events. You can create an activity log directly using spel. I'll share an example in a few hours.



  • 17.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-16-2018 08:15 AM

    Grant no problem thanks man. You star really.

     

    I will wait and then I’ll start with what you supplied.

     

    Thanks Grant Really

     

    regards

     

    Edgar Louw

    Secondary Technical Support

    Sanlam Group Technology and Information

     

     

     

    T +27 21 947 6483  C +27 83 784 8770

    edgar.louw@sanlam.co.za

    Sanlam Head Office, 2 Strand Road, Bellville, 7532

     

     



  • 18.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-16-2018 09:49 AM

    You're welcome, happy I can help.

     

    1. Create Activity Notification

    Symbol: Record Type Updated

    Code: CRTYPE

    Req/In/Pr: Checked

    Notification Rules: Attach your existing rule

     

    2. Trigger (place in mod file, zCR.mod)

    MODIFY cr POST_CI z_cr_type_change(type,persistent_id) 10105 FILTER(type{} && EVENT("UPDATE"));

     

    3. Spel (place in spl file, zCR.spl)

    cr::z_cr_type_change(...)
    {
        string  method, desc, typePrevious, typeNew, typeSymPrevious, typeSymNew, persid;
        uuid who;
        method  ="cr::z_cr_type_change"; 
        logf(MILESTONE,  "%s  started",  method);
        typePrevious   =  argv[2];
        typeNew        =  argv[3];
        persid         =  argv[6];
       
        send_wait(0,top_object(), "call_attr", "cnt", "current_user_id"); 
        who=msg[0]; 
       
        typeSymNew = (string)expand (format("&{'%s'=crt.code->sym}",  (string)typeNew));
        typeSymPrevious = (string)expand (format("&{'%s'=crt.code->sym}",  (string)typePrevious));
        desc = (string)format("Record Type changed from %s to %s", (string)typeSymPrevious, (string)typeSymNew);
       
        send_wait(0, top_object(), "call_attr", "api", "generic_activity_log", who, persid, desc, "CRTYPE", 0, 0); 
        if (msg_error()) { 
          logf(ERROR,"Error %s",msg[0]); 
        }

        logf(MILESTONE,  "%s  ended",  method);       
    }

     

    Here's how it'll look in the logs.



  • 19.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-24-2018 08:37 AM

    Hi Grant

     

    Ask you so much already, I question regarding this. Sorry again for asking you only. This spell script gave me, can I use it for zdate field as well. I will just configure it to call that. Or is this just for the CRtype. Sorry for asking. this works for CRtype i'm trying work of you script to make it for a zdate field called zeft_date = Date column.

     

    I have added date column in the script but I don't think his script is build for date fields . I will have have to change it a bit. it's just question.

     

    Regards

     

    Edgar Louw



  • 20.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-21-2018 05:35 AM

    Hi Grant

     

    Just want to ask will this send a mail when custom field updated. Will this make that possible to send a notification when that is updated everytime.

     

    Sorry I have made the audit log activity work already, it's when I want to send mail evertime that field updates. Is this what the spell does connection between the Associtaion and Activity Notificaiton.

     

    I reading your Spell now, and It seems this only adds the activity log and that works already. When add the Auditlog in the UI on the columnn it adds it in the Activity logs. If I'm reading your spell wrong sorry for being so dumb(me I mean, I'm dumb). Thanks again for sending trying it now. But just wanted to make sure.

     

    Regards

    Edgar Louw



  • 21.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-16-2018 10:08 AM

    Thanks Grant will have look at this tomorrow morning, Trying to build something.

     

    Thanks for help will try this tomorrow.

     

    Edgar Louw

    Secondary Technical Support

    Sanlam Group Technology and Information

     

     

     

    T +27 21 947 6483  C +27 83 784 8770

    edgar.louw@sanlam.co.za

    Sanlam Head Office, 2 Strand Road, Bellville, 7532

     

     



  • 22.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-24-2018 08:41 AM

    Reason i'm askin is it works for CRtype. Struggling with the date field, where I assume I will have state where "zeft_date -> 0 or not null\empty" Sorry for the asking i suck bit at spell other. Trying get better at it.



  • 23.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-21-2018 07:45 AM

    Yes, you can attach your notification rule to the activity notification. It will trigger every time the record type is updated.



  • 24.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-24-2018 09:21 AM

    Hi Edgar,

     

    That spel script is using generic_activity_log, which is a method for creating activity logs. You would need to use another method, update_object_super, to update fields on the ticket. I don't mind giving you an example, what time did you want to set in the zdate field?



  • 25.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-21-2018 07:56 AM

    Thanks Grant. Thanks Busy building it now.

     

    Edgar Louw

    Secondary Technical Support

    Sanlam Group Technology and Information

     

     

     

    T +27 21 947 6483  C +27 83 784 8770

    edgar.louw@sanlam.co.za

    Sanlam Head Office, 2 Strand Road, Bellville, 7532

     

     



  • 26.  Re: Activity Notification For the Call_TYPE in CA SDM

    Posted 05-24-2018 09:36 AM

    Hi Grant

     

    Thanks for helping, We call the field  - (Agreed Delivery Date) in front end.

     

    It’s not time based, when the analyst update the (zeft_date) column it must generate a mail to client. I have built all the necessary activity and associations, also added the (+AuditLog) on the field which makes it display in the  Activity logs. But no mail.

     

    As soon as add the (Field update) to the Related activity notification tab in the Rule, It sends a mail on all updates you do in incident updateable fields. We even tried to add site condition. Doesn’t help.

    So in short I need build it to send mail every time it’s updated.

     

     

     

     

     

     

     

     

     

     

    regards

     

    Edgar Louw

    Secondary Technical Support

    Sanlam Group Technology and Information