Add Ticket and CI Links to Announcements
From SDU
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.
To discuss or ask questions about this article, select the discussion tab above.
Overview
This article provides instructions on how to insert active links to Requests, Incidents, Problems, Issues, Change Orders, and Configuration Items (aka Assets) to an Announcement.
Procedures
Step 1. Edit the detail_cnote.htmpl form
In the body of the form, replace the entire bottom of the form beginning with <!-- handles the 'insert link' functionality --> with the content provided below.
<!-- handles the 'insert link' functionality --> <PDM_IF "$env.NX_CMDB" != "STANDALONE"> <PDM_IF "$prop.form_name_3" == "edit"> <br><br> <table border=5> <th class=label>Insert Object link <tr><td> <PDM_FORM NAME=INSERT_FORM> <input type=hidden name="KEY.linkItem" id="KEY.linkItem"> <input type=hidden name='SET.linkItem' id='SET.linkItem'> <input type=hidden name="obj_flag" id="obj_flag"> <table width=100%> <tr> <th ALIGN=left VALIGN=baseline WIDTH=150px CLASS=labeltext scope=row> <script type="text/javascript"> var lookupLinkTextKD; var linkTabindexKD; if ( ahdtop.cstUsingScreenReader ) { lookupLinkTextKD = "Look up Knowledge Doc" linkTabindexKD = ""; } else { lookupLinkTextKD = " Knowledge Doc" linkTabindexKD = " tabindex=" + (++_dtl.tabIndex); write_img_link("$CAisd/img/lookup.gif", "KD", "SET.linkItem", "INSERT_FORM", "", "Find KD", 0); } document.write("<a class=lookup" + linkTabindexKD + " style='font-size:1.0em;' href='javascript:void(0)' onClick=\"popup_search('KD','SET.linkItem', 'INSERT_FORM', '', 0);return false\">" + lookupLinkTextKD + "</a></th>") if ($ACCESS.call_mgr >= 1) { document.write("<th ALIGN=left VALIGN=baseline WIDTH=150px CLASS=labeltext scope=row>"); var lookupLinkTextCR; var linkTabindexCR; if ( ahdtop.cstUsingScreenReader ) { lookupLinkTextCR = "Look up Request" linkTabindexCR = ""; } else { lookupLinkTextCR = " Request" linkTabindexCR = " tabindex=" + (++_dtl.tabIndex); write_img_link("$CAisd/img/lookup.gif", "CR", "SET.linkItem", "INSERT_FORM", "", "Find CR", 0); } document.write("<a class=lookup" + linkTabindexCR + " style='font-size:1.0em;' href='javascript:void(0)' onClick=\"popup_search('CR','SET.linkItem', 'INSERT_FORM', '', 0);return false\">" + lookupLinkTextCR + "</a></th>") if ("$env.NX_OTB_MARKET" == "itil") { document.write("<th ALIGN=left VALIGN=baseline WIDTH=150px CLASS=labeltext scope=row>"); var lookupLinkTextIN; var linkTabindexIN; if ( ahdtop.cstUsingScreenReader ) { lookupLinkTextIN = "Look up Incident" linkTabindexIN = ""; } else { lookupLinkTextIN = " Incident" linkTabindexIN = " tabindex=" + (++_dtl.tabIndex); write_img_link("$CAisd/img/lookup.gif", "IN", "SET.linkItem", "INSERT_FORM", "", "Find IN", 0); } document.write("<a class=lookup" + linkTabindexIN + " style='font-size:1.0em;' href='javascript:void(0)' onClick=\"popup_search('IN','SET.linkItem', 'INSERT_FORM', '', 0);return false\">" + lookupLinkTextIN + "</a></th>") document.write("<th ALIGN=left VALIGN=baseline WIDTH=150px CLASS=labeltext scope=row>"); var lookupLinkTextPR; var linkTabindexPR; if ( ahdtop.cstUsingScreenReader ) { lookupLinkTextPR = "Look up Problem" linkTabindexPR = ""; } else { lookupLinkTextPR = " Problem" linkTabindexPR = " tabindex=" + (++_dtl.tabIndex); write_img_link("$CAisd/img/lookup.gif", "PR", "SET.linkItem", "INSERT_FORM", "", "Find PR", 0); } document.write("<a class=lookup" + linkTabindexPR + " style='font-size:1.0em;' href='javascript:void(0)' onClick=\"popup_search('PR','SET.linkItem', 'INSERT_FORM', '', 0);return false\">" + lookupLinkTextPR + "</a></th>") } } document.write("</tr><tr>"); if ($ACCESS.change_mgr >= 1) { document.write("<th ALIGN=left VALIGN=baseline WIDTH=150px CLASS=labeltext scope=row>"); var lookupLinkTextCHG; var linkTabindexCHG; if ( ahdtop.cstUsingScreenReader ) { lookupLinkTextCHG = "Look up Change" linkTabindexCHG = ""; } else { lookupLinkTextCHG = " Change Order" linkTabindexCHG = " tabindex=" + (++_dtl.tabIndex); write_img_link("$CAisd/img/lookup.gif", "CHG", "SET.linkItem", "INSERT_FORM", "", "Find CHG", 0); } document.write("<a class=lookup" + linkTabindexCHG + " style='font-size:1.0em;' href='javascript:void(0)' onClick=\"popup_search('CHG','SET.linkItem', 'INSERT_FORM', '', 0);return false\">" + lookupLinkTextCHG + "</a></th>") } if ($ACCESS.issue_mgr >= 1) { document.write("<th ALIGN=left VALIGN=baseline WIDTH=150px CLASS=labeltext scope=row>"); var lookupLinkTextISS; var linkTabindexISS; if ( ahdtop.cstUsingScreenReader ) { lookupLinkTextISS = "Look up Issue" linkTabindexISS = ""; } else { lookupLinkTextISS = " Issue" linkTabindexISS = " tabindex=" + (++_dtl.tabIndex); write_img_link("$CAisd/img/lookup.gif", "ISS", "SET.linkItem", "INSERT_FORM", "", "Find ISS", 0); } document.write("<a class=lookup" + linkTabindexISS + " style='font-size:1.0em;' href='javascript:void(0)' onClick=\"popup_search('ISS','SET.linkItem', 'INSERT_FORM', '', 0);return false\">" + lookupLinkTextISS + "</a></th>") } document.write("<th ALIGN=left VALIGN=baseline WIDTH=150px CLASS=labeltext scope=row>"); var lookupLinkTextNR; var linkTabindexNR; if ( ahdtop.cstUsingScreenReader ) { if ("$env.NX_OTB_MARKET" == "itil") { lookupLinkTextNR = "Look up Configuration Item" } else { lookupLinkTextNR = "Look up Asset" } linkTabindexNR = ""; } else { if ("$env.NX_OTB_MARKET" == "itil") { lookupLinkTextNR = " Configuration Item" } else { lookupLinkTextNR = " Asset" } linkTabindexNR = " tabindex=" + (++_dtl.tabIndex); write_img_link("$CAisd/img/lookup.gif", "NR", "SET.linkItem", "INSERT_FORM", "", "Find NR", 0); } document.write("<a class=lookup" + linkTabindexNR + " style='font-size:1.0em;' href='javascript:void(0)' onClick=\"popup_search('NR','SET.linkItem', 'INSERT_FORM', '', 0);return false\">" + lookupLinkTextNR + "</a></th>") var linktextIdText = detailNextID(1,true); var linktextID = _dtl.currID; document.write("</tr></table>\n"+ "<table style='margin-top:8px;' width=100%><tr>"); var text = "<th ALIGN=left VALIGN=baseline CLASS=labeltext width=40%>" + "Link Destination" + "</th>" + "<th ALIGN=left VALIGN=baseline CLASS=labeltext width=60%><label for='" + linktextID + "'>Link Text</label></th></tr>" + "<tr>" + "<td align=left valign=bottom class=detailro id=linkitemID>"+ "</td><td>" + "<input" + linktextIdText + " type=text size=60 name=" + linktextID + " value=''></td></tr>"; document.write(text); document.write("<tr><td align=center colspan=2><br>"); ImgBtnCreate("InsertItem", "Insert Link", "javascript:do_insert()", false, 0); document.write("</td></tr>"); </script> </tr> </table> <script type="text/javascript"> // To capture persid of returned item var curPersid = ""; function backfill_event(momform, field_name, what2fill, persid, rel_attr_val) { if ( field_name == "SET.linkItem" && typeof persid == "string" && persid.length > 0 ) { var commonName = document.getElementById("SET.linkItem").value; ImgBtnEnableButton("InsertItem"); curPersid = persid; var currId = persid.substring(3); var obj = persid.substring(0,2); document.getElementById("SET.linkItem").value = currId; document.getElementById("obj_flag").value = obj; if ( obj == "KD") { document.getElementById("linkitemID").innerHTML = "Doc " + currId; } else { var obj_desc = ""; switch ( obj ) { case "cr" : obj_desc = "Req/Inc/Prb "; break; case "ch" : obj_desc = "Change "; break; case "is" : obj_desc = "Issue "; break; case "nr" : obj_desc = "Config. Item "; break; } document.getElementById("linkitemID").innerHTML = obj_desc + commonName; } var e = document.getElementById(linktextID); e.value = commonName; e.focus(); } } // Inserts and HTML link into the announcement text function do_insert() { if (null != curPersid && curPersid.length > 0) { var key_val = document.getElementById(linktextID).value; if (typeof key_val == "undefined" || key_val == null || key_val.length <= 0) { alert(msgtext(727)); return; } var el_text = findElem("SET.text"); var doc_id = curPersid.match(/[0-9]+/); if (document.getElementById("obj_flag").value == "KD") { var link_txt = "<A HREF=\"javascript:OpenDocumentViewer(" + doc_id + ", 2);\">"; } else { var link_txt = "<A HREF=\"javascript:showDetailWithPersid('" + curPersid + "');\">"; } link_txt += key_val + "</a>"; el_text.value = el_text.value + link_txt; } } </script> </pdm_form> </table> </PDM_IF> </pdm_if> <PDM_INCLUDE FILE=std_footer.htmpl> </BODY> </HTML>
For r11.x releases it is recommended that you edit your pages via the Web Screen Painter.
Step 2. Clear the web cache
The final step is to clear Service Desk's cache. The methods vary depending on release.
For r11.x releases publish your changes via the Web Screen Painter. The process of publishing automatically initiates a pdm_webcache.







