Home Cireson Uploads
image


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.

RequestedByUser Field in Cireson Portal

Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭

Hi Community, 

I have recently been in discussion with a few customers about the possibility of adding in the RequestedByUser field onto a WorkItem form. Currently, this does not work due to the field having the same target name as CreatedByUser, both which share the property name "CreatedWorkItem”. This is an issue in the Microsoft coding. 


After testing in JavaScript and with a big help from @john_doyle and @Justin_Workman we have come up with a custom solution for this. Below is a link to the GitHub repo containing these 3 files: 

  1. Custom.WorkItem.RequestedByUser.xml 
  2. CustomForm.txt 
  3. RequestedByUser.js 

https://github.com/shanewh1te/RequestedByUser  


The management pack contains a custom type projection that specifically points to the RequestedByUser Relationship and is used by the JavaScript code for the API call.  

(NOTE: You can use your own custom Type Projection, but note 2 things: 

  1. The type projection must not include the RequestedByUser and CreatedByUser relationships 
  2. You must find the Id of this type projection and change the variable in the RequestedByUser.js code) 

The CustomForm.txt contains the code to be added to your custom form for Incident.js/ServiceRequest.js 

The RequestedByUser.js can either be copied directly to your Custom.js file inside CustomSpace, or loaded in using something like a script loader. 


Once you have downloaded these files, perform the following: 

  1. Import the provided management pack (recommended) 
  2. Copy CustomForm.txt code into the Incident.js or ServiceRequest.js custom form code as needed 
  3. Copy the RequestedByUser.js code to Custom.js or load it using a script loader 


You should then notice the CreatedByUser and RequestedByUser fields now can exist on the same WorkItem form without error! 

Hopefully this helps to solve a common Microsoft issue 😁 

Thanks, 

Shane

Comments

Sign In or Register to comment.