Relate Issues And Change Orders
Creating a LREL between Changes and Issues
Contents
Adding the Cutomization
Create a LREL relation between Issue and Change Order
- Write a majic file called “lrel1.maj”, in site\mods\majic folder with the following contents:
<source lang="text" >LREL lrel1 iss impacted_iss <> chg impacted_chg;</source>
- Recycle the service
- Verify if these objects have been created properly by giving the commands
- Bop_sinfo –da chg
- Bop_sinfo –da iss
We can check the same information in the wsp_schema table from the MDB. Explanation:
- Impacted_iss is the Lrel object to the Issue (iss) Table with the Changes related to the Issue.
- Impacted_chg the Lrel object to the Change (chg) Table with the Issues related to the Change.
Create a customised htmpl tab page called “chg_iss_tab.htmpl”
<source lang="html4strict"> <html lang="en"><HEAD> <PDM_PRAGMA RELEASE=110> <PDM_WSP mode=edit factory=chg preview="NBTAB=chg_iss_tab"> <PDM_INCLUDE FILE=styles.htmpl> <PDM_INCLUDE FILE=std_head.htmpl busy=no> <SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT> </HEAD> <BODY> <PDM_INCLUDE FILE=std_body.htmpl filename=""> <PDM_FORM NAME="frmDTLRO"> <SCRIPT LANGUAGE="JavaScript"> tab_banner("Related Issues List");
docWriteln("Ref# | "); docWriteln("Status | "); docWriteln("Description | "); docWriteln("");
docWriteln("No Issue Attached"); docWriteln(" | ");
<PDM_MACRO NAME=dtlEndTable>
<PDM_ELSE>
var counter=0;
<PDM_LIST SOURCE=args.impacted_chg>
var sClass;
if(counter%2)
sClass = "results1";
else
sClass = "results0";
counter++;
var strHTML="
---|---|---|
");
var start_a_tag = "<A" + detailNextID(true) + " HREF=\"javascript:showDetailWithPersid('" + '<PDM_FMT ESC_STYLE=C>$args.impacted_chg.persistent_id</PDM_FMT>' + "')\">"; var ecsaped_name=<PDM_FMT ESC_STYLE=C>"$args.impacted_chg.ref_num"</PDM_FMT>; end_a_tag="</A>"; docWriteln(start_a_tag+ecsaped_name+end_a_tag); docWriteln(" | ");
docWriteln('<PDM_FMT ESC_STYLE=C PAD=NO>$args.impacted_chg.status.sym</PDM_FMT> | '); docWriteln('<PDM_FMT ESC_STYLE=C PAD=NO>$args.impacted_chg.description</PDM_FMT> | '); docWriteln("
</SCRIPT> </PDM_FORM> </BODY> </HTML> <PDM_IF 0> </source>
Modifications to 'detail_chg.htmpl'
Create a button to attach Issues <source lang="JavaScript"> ImgBtnCreate("UPDATE_LREL", "Attach Issues", "update_lrel('chg', '$args.persistent_id', 'iss', 'impacted_chg', 'Issues', msgtext(211), )", true, 0); </source>
Include a tab called “Related Issues” in the Change page (detail_chg.htmpl): <source lang="JavaScript"> <PDM_TAB ID=rel FILE="chg_iss_tab.htmpl" NAME="Related Issues"> </source>
Modifications to 'list_iss.htmpl'
Add the below line <source lang="JavaScript"> <PDM_IF "$args.KEEP.ForLrel" == "1"> document.writeln('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_lrel_iss.htmpl>'); </PDM_IF> </source> After the line <source lang="JavaScript"> <PDM_IF "$args.KEEP.Forchild" == "1"> document.writeln('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_lrel_iss.htmpl>'); </PDM_IF> </source>
Explanation:
This is added so that when we search for the Issues to be attached to the current Change Request the search page will not go to the default list page but go to the update_lrel_iss.htmpl page.
Note: Follow the above 3 points (1.2 through 1.4) with the object Iss (Issue) also:
- Create a new iss_chg_tab.htmpl using the same code, but change Iss to Chg and vice-versa. Make sure you use 'impacted_iss' instead of 'impacted_chg' as the source of the list.
- Create a button to attach Changes and include the 'Related Changes' tab (iss_chg_tab.htmpl) to the detail_iss.htmpl page, using the same code, but also change Chg to Iss and the other way around.
- Modify 'list_chg.htmpl' and add the needed line (see 1.4), substituting update_lrel_iss.htmpl with update_lrel_chg.htmpl.
How to use the Customization
After logging in the Service Desk web interface, open a Change Order:
When you click on 'Attach Issues' the search filter for Issues will be shown:
Click Search and you'll get a list of Issues
Add the Tickets that needs to be attached and then see the tab “Issues” to find all the attached Issues to the current Change Order