RequestedByUser Field in Cireson Portal

Shane_WhiteShane_White Cireson Support Ninja 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

Sign In or Register to comment.