IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.
DISCLAIMER
All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.
Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.
Dont forget to checkout solutions uploaded by our customers, partners and community members here.
Incident Form Header: "This Incident Is Linked To Problem: XXXXX [STATUS]"
Helps quickly see if the IR is linked to a PR and its status:
Tested on v7.4
//Add Problem Link to the top of the IR form app.custom.formTasks.add('Incident', null, function(formObj, viewModel){ formObj.boundReady(function () { if (typeof viewModel.RelatesToWorkItem[0] != 'undefined' && viewModel.RelatesToWorkItem[0].ClassName == 'System.WorkItem.Problem') { $("#parent-header-space").append("<div><div class='parent-header-link'><label>This incident is linked to problem</label> : <a data-bind='attr: { href: view.controller.editHref}, text: view.controller.editLink' target='_blank' href='/Problem/Edit/" + viewModel.RelatesToWorkItem[0].Id +"/'>" +viewModel.RelatesToWorkItem[0].Id + "</a> <span class='label label-info label-heading'>" + viewModel.RelatesToWorkItem[0].Status.Name + "</span></div></div>"); }; }); });
Comments
I tried altering the script to apply to CRs and RRs, but it doesn't show up. Could this be because a CR doesn't have a parent/child function and the #parent-header-space doesn't exist in the CR form?
Edit: @john_doyle
Is it possible that you are using a different relationship to associate the CR and RR workitems? You could try replacing all the references to RelatesToWorkItem with HasRelatedWorkItems in the script and test again.
That doesn't work for us either. I'm only creating relationships through the portal.
Hi, this looks great! Is this added to the incident.js file?
As we are implementing a problem management in our environment in the next few months, this custom solution would be really helpful. But it seems like it is no longer working in 11.8.4 - But I don't receive any error messages in the dev tools.
As Cireson is using this one as well, I wanted to ask if some adjustments to the code are necessary and if, if you could publish this code :)