There have been a number of discussions recently with respect to only pushing the Users responses (Dynamic) to questions to the "Notes / Detailed Description" field without including all of the fields in the mappings as shown when viewing the submitted request "Additional Information" tab. I recently tasked one of the developers on a project (Bright Consulting SRM Guru to be and all around good guy - Viktor Elevterov) with the coding for this after an initial design discussion as I have been meaning to do this for some time to provide the customer with a "clean" solution with consistency from SRM to the fulfilment application. This was to be designed as an "add-on" with zero or minimal customisation to the OOB workflow.
Below is the information and final design that Viktor ultimately coded (with a couple of very cool additional features to allow flexibility on what SR Field you push the concatenated information) and how to trigger the initiation of the feature via a Keyword.
Note: This was designed on a SRM 8.1.x system, therefore there will/may be additional coding required to retrofit this into an earlier version of SRM.
A common practice in BMC Service Request Management is to concatenate the questions and user-provided responses captured at a service request submission and push this data to a field in one or more tickets in the fulfilment application. Usually the Notes (Detailed Description) field is used for the purpose. The OOTB SRM solution allows us to map all questions together with their corresponding answers to a variable which is further used in a PDT using the “Advanced Mapping” option in the SRD Questions and Mappings section. However this approach has two disadvantages:
- Questions situated under branches need always to be mapped and thus their labels are always present in the output even if these questions were not presented to the submitter when filling the questionnaire because they have chosen a option in the “conditional” question.
- Application administrators need to put effort into manually concatenating question labels and user input fields to produce the final outcome which in some complex SRDs can be time consuming and laborious to adjust / modify when
The customisation described below aims to provide a solution for this by automating the concatenation and pushing the “Notes” data to an SR Type field of a user’s choice (usually "SR Type Field 1" due to its CLOB size of unlimited) upon Service Request submission.
1 Solution Design
One additional custom regular form called MPS:SRM:QuestionResponseData is created to facilitate pulling and parsing all relevant questions and concatenating them into the “Data” field in their correct order. The source for this data is the OOTB form SRD:MultipleQuestionResponse where the Request Entry portal in BMC Service Request Management pushes all relevant questions and the user responses in a question/response per entry basis. This form is used as a source for a table z2TH_QuestionResponses which lists all records relevant for the service request identified by its Instance ID which should be populated in the SR Instance ID field in MPS:SRM:QuestionResponseData and sorted by the order in which they are presented in the SRD questionnaire including the “conditional” questions.
The workflow executed on this form works as follows:
- The Instance ID of an existing Service Request is pushed thus submitting new record in form "MPS:SRM:QuestionResponseData"
- This triggers a Filter calling a Filter Guide "MPS:SRM:QRD:PushLineItemToDataField_GUIDE"
- The Filter Guide is looping through the rows in the "z2TH_QuestionResponses" table pushing a single question/response record to a temporary display-only field "tmp_String"
- Some parsing is done on this field i.e. to remove HTML tags which mark the question as required:<span class=""required"">*</span>
- Finally the question/response string is appended to the QuestionResponsesData field from the temporary field
The above functionality comes in use when data mapped to any of the “character” SR Type fields populated in the SRD is pushed to form SRM:Request on Service Request submission.
The OOTB filter "SRM:REQ:MapSRFields_ParseFormula" is customised to call the custom guide "MPS:SRM:REQ:MapSRFields_SetSRTypeQuestionsConcat_GUIDE" which contains only one Filter "MPS:SRM:REQ:MapSRFields_SetSRTypeQuestionsConcat`!".
This Filter is only fired for an SR Type field when its current value is the custom defined keyword ="SETQUESTIONRESPONSE".
This is done to avoid attaching our questions/responses to every character SR Type Field in the SRM:Request record and this “keyword” is set to the desired SR Type Field in the SRD Mapping.
The purpose of the Filter is to:
- Push the Instance ID of the Service Request to SR Instance ID field in the described custom form and to trigger its associated workflow.
- Pull the parsed and concatenated questions/responses string from the form and set it to z1D_Char1 field in the SRM:Request record to which previously has been assigned the SETQUESTIONRESPONSE “keyword” thus replacing it with the required text.
After this point the OOTB workflow on SRM:Request should continue now with the required data populated in the SR Type Field.
Note: This deployment package is created on/for SRM version 8.1.x and may not work correctly on other versions of SRM
All workflow is included in the embedded def file and consists of the following workflow objects:
Custom regular form
Overlayed and customised OOTB filter
Import the definition file via BMC Remedy Developer Studio in “Best Practise Customization Mode” - you can included or exclude the Packing List as required.
3 Instructions For Usage
Each of the character SR Type Fields can be used to hold the concatenated question/response string but it is recommended to use SR Type Field 1 due to its larger unlimited size [CLOB on DB level]. The SR Type Field being used needs to be set to the “keyword” SETQUESTIONRESPONSE in the SRD Questions and Mappings dialog in the SR Field Mapping tab.
This configuration is enough to get the question/response data populated to the SR Type Field in the "SRM:Request" form when the request is finally submitted and set into “In Review” status.
** Please note that if the request is still in “Draft” or “In Cart” statuses the question/response data will still not be populated.
Additionally in order to get the same data pushed to a PDT Variable, the same SR Type Field needs to be mapped to a PDT Variable in the Variable Mapping tab.
Further the PDT Variable has to be pushed to the exposed fields in the fulfilment application.
I hope BMC consider this as a future enhancement to SRM.
Download the "SRM_Question_Auto_Concatenation.def" and import.
Double Quote issues?
NOTE: If you are having issue with double quote entries e.g. "value", download the "MPS_SRM_QRD_ParseString_Quotes.def" and add to the following Guide after the "MPS:SRM:QRD:ParseString" Filter: