CA Service Management

Multiple CIs on Request / Incident / Problem (CR to NR lrel/brel) 

06-09-2016 12:36 PM

Multiple CIs on Request / Incident / Problem (CR to NR lrel/brel)

This customization allows you to associate multiple CIs with a Request, Incident, or Problem.  The attached files show an example of this customization on Incident record.  To add this to the Request or Problem review the modifications to the detail_in form and copy the additional code to detail_cr or detail_pr.

 

Notes:

  • Use at your own risk!  CA will not provide support for this level of customization.
  • CA may add an OOTB CR to NR LREL relationship in a future update.  Ideas for this functionality can be found here and here.  If you implement the functionality provided in this document  and CA releases this as an OOTB option you may have to extract the data out of the custom lrel table and import into an OOTB lrel table, then remove this customization.
  • Files are included in attached zlrel_cr_nr.zip.
  • Modified files are from 14.1.02, see comments in files know what to copy to earlier versions.

 

  1. Create a custom table via WSP
    1. zlrel_cr_nr
    2. Set function group to Incident/Problem/Request
  2. Add fields to custom table
    1. cr SREL cr
      1. Check Required
    2. nr SREL nr
      1. Check Required
    3. Last_mod_by, last_mod_dt, persistent_id, and producer_id will be added automatically.
  3. Save and publish schema changes
  4. Stop services
  5. Execute pdm_publish to add schema changes to the database
  6. Copy file named “zlrel_cr_nr.maj” to “nx_root\site\mods\majic”
  7. Start services
  8. Copy the htmpl files to nx_root\site\mods\www\htmpl\web\analyst
    1. Modified OOTB files includes comments prefixed with “Customer modification”
  9. Execute pdm_webcache -H

 

 

Screenshot (displays lrel data via list_nr.htmpl)

 

Sources:

cdtj - How to create custom BREL/QREL/LREL attribute

Rollas from SDU - (LREL- BREL) Contact to Change

Statistics
0 Favorited
8 Views
2 Files
0 Shares
3 Downloads
Attachment(s)
zip file
zlrel_cr_nr.zip   21K   1 version
Uploaded - 05-29-2019
zip file
Incident - Business Service Tab Customization.zip   328K   1 version
Uploaded - 05-29-2019

Tags and Keywords

Comments

12-25-2017 11:17 AM

Hi gbruneau

 

I followed the entire document as you showed it, but I can not attach the IC.
Attempting to attach the IC appears the error message below.

 

 


Do you know what the problem is?

10-18-2017 02:14 PM

Oh i got it..  I think you would have to publish a new attribute on the NR schema and write some spel code to increment up for each Incident that the CI is attached to.  I'm not sure you can combine the two on the form side.

10-18-2017 02:05 PM

Sorry, I noticed that, what I want is Inc CI and Inc List combined.

 

Thanks,

 

Will Fugate

Applications Architect | Tools for the Application Process (TAP)

 

Humana

T 502.580.8315

E wfugate@humana.com<mailto:wfugate@humana.com>

 

For more information, visit:

SQuIDS<http://go/squids>  |  SQMO Reports<http://go/sqmoreports>  |  Secure Code Scanning<http://go/scm> | Test Automation<http://go/testautomation> | VersionOne<http://go/acop> | Service Desk<http://go/css>

 

TAP into your delivery potential!

10-18-2017 02:01 PM

Hi wfugate,

 

The attached list_nr.htmpl file has what you're looking for..  Here's how it looks on my end.

 

10-18-2017 01:42 PM

I just got around to reviewing your changes, thanks for that it certainly helps having the Incidents attached to the CI's, but I was actually talking about incrementing the incident count on the CI.  If you look at the imaged I attached for CI ticket counts you see #Inc: 3, if you add the same CI to another incident ticket in the Configuration Item field, the count goes to 4, if you add the same CI to another incident ticket via this method then the count stays at 3.  I will look into it and see if I can figure it out, I was just wondering if you had already looked into it.  I will update the page if I can figure it out.

10-10-2017 09:48 AM

Hi,

 

I published a new version of the document.  The attached zip now includes cmdbNotebook.htmpl and an additional line on list_nr.htmpl which add the count that you're looking for and a tab on the CI record.

 

Thanks for the suggestion!

10-10-2017 09:10 AM

Yes, after adding a CI to the ticket, the ticket does not show up as a related ticket.  There is also a counter that is updated when attaching a CI to an incident ticket's configuration item field that isn't accumulated with the tab.

 

10-09-2017 12:40 PM

Hi,

 

Are you talking about the Related Tickets tab on a Configuration Item?

10-09-2017 11:49 AM

I implemented this but noticed that the incident count does not accumulate for attached CI's as it does for Change Orders.... Have you ever looked into implementing the incident accumulation count?

07-14-2017 11:56 AM

That's great!  I'm surprised that was necessary as I thought restarting services would rebuild the cache.

07-14-2017 07:50 AM

Afternoon

We finally got it working.  It would appear that it was necessary to do a pdm_webcache before it would work, irrespective of the fact that we published the document and the publish function runs a pdm_webcache.

Once again, thank you for you assistance and willingness to share knowledge and know-how.

07-13-2017 02:47 AM

Many thanks for sharing the information and customization down to form level.  I am still experiencing the same error after confirming everything is correct.  I will follow your advice and try and implement it on an untenanted installation to check.  There is most probably a tenant reference that is required in one of the reference strings that is preventing it from displaying at the moment.  As soon as I have it, I will update this call with the finding.  

Your assistance has been greatly appreciated.

07-11-2017 12:18 PM

Here's a working example and instructions for this customization (without multi-tenancy).

OneDrive link 

07-11-2017 11:47 AM

I have never used multi-tenancy so I'm not sure if it would make a difference.  If you have a test system running without tenancy i suggest trying to get the customization working there first.  Then once you have that working shift to your dev system that is running multi-tenancy. 

07-11-2017 11:45 AM

My zlrel_cr_loc.maj file that I created was exactly the same as the example that you supplied as well.

I cannot help but wonder if i am missing a document.write statement for the Keep.forCRToLoc == 1 argument. 

07-11-2017 11:41 AM

I wish everything was simple, but our motto down here in South Africa always seems to be - "Maximum Difficulty".

My detail_in form had the exact same reference on the TAB and I have double checked everything.  The information is being saved to the zlrel_cr_loc table correctly, but it will not display in the list_loc form as it is called through the detail_in.

I need to let you know that we have a tenanted environment, and I had to make the customized table "Tenant Optional" before I could actually save anything to it.  Would this perhaps make a difference to any of the customization that is required on either of those two forms.

07-11-2017 09:30 AM

That looks to be correct.  On the detail_in form you need to add a reference to track_asset.js.  Then your tab macro would look like this.  Let me know if that works.

 

<PDM_MACRO name=tab title="Locations" height=600 id=ext_loc src="OP=SEARCH+FACTORY=loc+QBE.EQ.zloccr.cr.id=$dob.id+KEEP.forCRToLOC=1">

 

The .maj file should look like this.

 

zlrel_cr_loc.maj

//////////// zlrel_cr_loc ///////////

////////////////////////////////////////////////////////////////////////
// Factory: cr
////////////////////////////////////////////////////////////////////////

OBJECT cr {
ATTRIBUTES Call_Req {
zcrloc BREL zlrel_cr_loc cr { LREL loc; } ;
};
};

////////////////////////////////////////////////////////////////////////
// Factory: loc
////////////////////////////////////////////////////////////////////////

OBJECT loc {
ATTRIBUTES ca_location {
zloccr BREL zlrel_cr_loc loc { LREL cr; } ;
};
};

07-11-2017 05:25 AM

Hi Grant

We are currently on version 14.1 #cum1.  I was almost certain that it was necessary to add more customisation to the list.loc form and I have tried to put every single bit from your example list_nr form into my list_loc form and every time I land up breaking the form.  Below is the entire extract of my current list_loc form including the customisation that I have added to get to the point that I am.  Your assistance is much appreciated.

 

-------------------------------------------------------------------------------------

<PDM_IF 0>
$Id: list_loc.htmpl,v 1.2 2006/11/08 00:16:23 olsjo01 Exp $
list_loc.htmpl
WHEN PRESENTED:
When we need to display a list of Customer Locations.
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110>
<PDM_INCLUDE FILE=styles.htmpl>
<SCRIPT LANGUAGE="JavaScript">
var hdrTitle = "Location Search";
var hdrTitleList = "Location List";
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl >
<SCRIPT LANGUAGE="JavaScript">
var rptName = new Array("locationsum.rpt", "location.rpt");
var cfgCanEdit = true;
if(typeof ahdtop != "undefined" && typeof ahdtop.toolbarTab != "undefined" && ahdtop.toolbarTab[ahdtop.toolbarCurrentTab].code=='sd')
var cfgCanCopy = false;
else
var cfgCanCopy = true; //'Copy' entry in right click context menu of list page
</script>
<PDM_IF 0>
// Modification to interpret forCRToLOC variable which was passed from detail_in, this loads required JS for updating lrel relationships
</PDM_IF>
<PDM_IF "$args.KEEP.forCRToLOC" == "1">
<script language="JavaScript" src="$CAisd/scripts/webtab.js"></script>
<script language="JavaScript" src="$CAisd/scripts/detail_form.js"></script>
<script language="JavaScript" src="$CAisd/scripts/track_asset.js"></script>
<script language="JavaScript" src="$CAisd/scripts/update_lrel.js"></script>
</PDM_IF>
<script>

<PDM_IF 0>
// Modification - added function to create LREL relationships between CR and LOC, will only be called when forCRToLOC is true.
</PDM_IF>
<PDM_IF "$args.KEEP.forCRToLOC" == "1">
var cfgCanEdit = false;
var cfgCanCopy = false;

var enableExtraBtn = false;
<PDM_IF "$args.KEEP.forCRToLOC" == "1">
var enableExtraBtn = true;
</PDM_IF>


cfgExtraButton = new Array("Attach_Locations", "zcrloc()", enableExtraBtn);

function zcrloc() {
update_with_lrel_style('cr', ahdframe.argPersistentID, 'loc', 'zcrloc', 'Available Locations', 'Attached Locations', '', "KEEP.forCRToLOC=0");
}
</PDM_IF>

</SCRIPT>
<PDM_INCLUDE FILE=std_list_include.htmpl>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD>
<BODY CLASS="list">
<PDM_INCLUDE FILE=std_body.htmpl filename="Location">
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF 0>
// Modification to interpret forCRToLOC variable which was passed from detail_in. This excludes the Create button from the list_loc form exposed on detail_in
</PDM_IF>
<PDM_IF "$args.KEEP.noSFBtns" == "1">
<PDM_MACRO name=sfStart button=false export=no factory=loc>
<PDM_ELSE>
<PDM_IF $ACCESS.FAC_loc \> 1 && "$args.KEEP.forCRToLOC" != "1">
<PDM_MACRO name=sfStart factory=loc>

<PDM_ELSE>
<PDM_MACRO name=sfStart create=false factory=loc>

</PDM_IF>
<PDM_IF "$args.KEEP.ForLrel" == "1">
document.write('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_lrel_loc.htmpl>');
</PDM_IF>
<PDM_IF "$args.QBE.EQ.service_pcat.pcat.id" != "">
document.write('<INPUT TYPE="hidden" NAME="QBE.EQ.service_pcat.pcat.id" VALUE="$args.QBE.EQ.service_pcat.pcat.id">');
</PDM_IF>
<PDM_IF "$args.QBE.EQ.service_isscat.isscat.id" != "">
document.write('<INPUT TYPE="hidden" NAME="QBE.EQ.service_isscat.isscat.id" VALUE="$args.QBE.EQ.service_isscat.isscat.id">');
</PDM_IF>
<PDM_IF "$args.QBE.EQ.service_chgcat.chgcat.id" != "">
document.write('<INPUT TYPE="hidden" NAME="QBE.EQ.service_chgcat.chgcat.id" VALUE="$args.QBE.EQ.service_chgcat.chgcat.id">');
</PDM_IF>
<PDM_IF "$args.QBE.EQ.service_groups.cnt.id" != "">
document.write('<INPUT TYPE="hidden" NAME="QBE.EQ.service_groups.cnt.id" VALUE="$args.QBE.EQ.service_groups.cnt.id">');
</PDM_IF>
<PDM_MACRO name=sfStartRow>
<PDM_MACRO name=sfDropdown hdr="Active" attr=delete_flag>
<PDM_MACRO name=sfTextbox hdr="Name" attr=name size=20>
<PDM_MACRO name=sfLookup hdr="Timezone" attr=timezone>
<PDM_MACRO name=sfStartRow>
<PDM_MACRO name=sfTextbox hdr="Description" attr=description colspan=3 size=60>
<PDM_MACRO name=sfEnd>
</SCRIPT>
<PDM_IF "${current:n/a}" != "n/a">
<SCRIPT LANGUAGE="JavaScript">
var msgFoundNone = "No locations found";
var msgFound1 = "1 location found";
var msgFound = "%1 locations found";
var msgFoundMore = "%1 locations found. Displaying %2 through %3";
var msgSelect = "Click to select desired location";
<PDM_MACRO name=lsStart>
<PDM_MACRO name=lsCol hdr="Name" attr=name exportFmt=ShowLink link=yes startrow="no">
<PDM_MACRO name=lsCol hdr="Description" attr=description startrow="no" width=60>
<PDM_MACRO name=lsCol hdr="Timezone" attr=timezone startrow="no" width=30>
<PDM_MACRO name=lsCol hdr="Record Status" attr=delete_flag.sym startrow="no">
<PDM_MACRO name=lsEnd>
</SCRIPT>
</PDM_IF>
<PDM_FORM NAME="frmFID">
</PDM_FORM>

<PDM_INCLUDE FILE="std_footer.htmpl">
</BODY>
</HTML>
<PDM_WSP>

07-10-2017 12:07 PM

Hi Chris,

 

We've also done this customization for Location.  It requires adding some logic onto the list_loc form..  Can you share what version you're using and if you have any customizations on list_loc?

07-10-2017 11:24 AM

Hi Grant

Thank you so much for such an informative post.  

I am working at a client that requires the same functionality between the cr (call_req) and loc (location) factories.  Taking all the information that you have supplied, I have been able to get to a point where I am able to update multiple locations to the incident, but the location list (called from the detail_in.htmpl) does not show the saved list.  However, if I try and attach further locations, the existing attached locations are available.

The information is being correctly saved in the customized zlrel table that I have created.

I decided to start again from scratch and noticed in your document that this is something that you may already have done as you have a zlrel_cr_loc table created in your schema.  I am really struggling to get the list_loc.htmpl form to show the attached locations, but do not know what code to bring over from the list_nr.htmpl form to make this work. 

Any assistance would be highly appreciated.

 

Regards

Chris

06-23-2017 06:33 AM

Sorry, my bad. I had not copied the .maj file. After I copied the file and recycled the services, it is working. Thanks for the detailed document

 

Thanks,

Chandan Joshi

06-23-2017 06:17 AM

Hi Grant,

 

I went through your doc and did the same changes in our dev environment and copied your files. However, when I open any existing incident or a new incident, there are already 23016 CIs attached to the incident by default. I am not able to understand why is this happening. Please see below screenshot of the Attached CIs tab. Can you please help me if I am missing something here?

Thanks,

Chandan Joshi

06-09-2016 04:39 PM

Thanks for sharing with the community Grant!

Multiple CIs on Request / Incident / Problem (CR to NR lrel/brel)

Related Entries and Links

No Related Resource entered.