CA Service Management

Create activity notification and link to custom menubar activity 

Oct 06, 2015 05:26 PM

Hi Community,

 

I was tasked with developing a solution that enables communication of Major Incidents at a more controlled level.  Specifically the ability to manually trigger notifications which can pull their own set of information from the Incident schema.  Due to this requirement I was not able to use the Initial or status Activity Notifications because the business wants manual control of the notifications.

 

To satisfy this requirement I figured out how to extend the Activities menubar with activities that interface with the detail_alg form.  The purpose of this post is to share my findings with anyone who is looking to extend the menubar/activities in a similar way.  I found it easier to add a custom activity to the menubar than hack up and re-use an existing menubar option, in my opinion this solution is less confusing for both administrators and users of the system.

 

Let me know if you have any questions or comments, thanks!

 

 

Step 1: Create New Activity Notification

  • Navigate to the Administration section then Notifications->Activity Notifications
  • Create new Activity Notification
    • Symbol: Major Incident (Or whatever makes sense for you)
    • Code: MIA (Major Incident Activity, use whatever makes sense)
    • Next check any fields as necessary
    • The form should look similar to Figure 1.

 

Step 2: Set up Notification Rule/Message Template

  • Utilize existing Notification Rule and Message Template or custom version as desired
  • Attach Notification Rule to Activity Notification via Activity Notification screen

 

Step 3: Customize detail_alg.htmpl form

  • Copy detail_alg.htmpl to a custom form group
  • Insert your pdm_macros in the section around the second pdm_macro for alg.description (Line 497 in file versioned for 14.1.01)
    • Data from the pdm_macros I've used are all attached to a custom Major Incident notification template which is triggered by the save activity on detail_alg.htmpl.
  • Code example: The PDM_IF statement below will conditionally display the fields listed when the Activity Notification type is Major Incident, the activity created in step 1. (Add any fields from detail_in as desired)
    • Important: Change the "MIA" value to the code from the Activity Notification created in Step 1.
<PDM_IF "$args.ACTIVITY_LOG_TYPE" == "MIA">
<PDM_MACRO name=dtlStartRow>
<PDM_MACRO name=dtlDate hdr="Start Time" attr=outage_start_time colspan=1 make_required=yes>
<PDM_MACRO name=dtlDate hdr="End Time" attr=outage_end_time colspan=1 make_required=yes>
<PDM_MACRO name=dtlHier hdr="Root Cause" attr=rootcause colspan=1 make_required=yes>
</PDM_IF>









Step 4. Customize menubar_sd.htmpl

  • Copy menubar_sd.htmpl to a custom form group
  • Insert new code into Activities menu section
  • Code example: I took the if statement from an existing activity.  If desired you can easily change this to use functional access objects.  You can see below where I set the display name for this activity as "Major Incident...", change this as desired.
    • Important: Change the \"MIA\" value to the code from the Activity Notification created in Step 1.
<PDM_OBJECT>
if ("$env.NX_EDIT_INACTIVE" != "No" || (typeof main_frame.argActive != "undefined" && main_frame.argActive == "1"))
{
<PDM_MACRO name=menuItemLocal label="Major Incident..." function="JavaScript: popupActivityWithURL('\" + query_str1 + \"MIA\" + alg_edit_htmpl + \"')">
}
</PDM_OBJECT>








 

  • Functional access example:  The if statement below reads, if the user has modify access to incidents then display this menubar item.  You can create your own functional access groups via the administration interface and all you need to do is change the "FAC_in" string to "FAC_<functional access code>". (>= 2 is Modify access) (>=1 is View access) (>=0 is No access)
if ( $ACCESS.FAC_in >= 2 ) {
<PDM_MACRO name=menuItem label="New_Incident..." function="ahdtop.create_new('cr',0,'','','PRESET=type:I')" hotkey=I icon_name=new_incident_16.png tooltip="create a new incident">
}








 

 

Figure 1:

min.png

Statistics
0 Favorited
6 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.