Requirement:
When a request for change is submitted by a user via a service request with resource answers, then a change should be auto-created, resource answers copied to its description, and the change should be associated with the service request
Usecase:
Service requests are often used to allow the requester to log a request for change. The details for the change are captured using the resource questions section and FAFR is used to make the resource questions interactive. Therefore, when a request for a change-service request is submitted by a requester, it has to create a change with all the details and resource answers in its description and be associated with the service request.
Steps to configure:
1. Download the attached scripts. Copy the contents into Request custom functions.
2. Goto Admin > Request Custom Function > Global Function > New > Paste the global function contents and save it with a name.
Update the URL and integration/technician key in the script.
- For builds over 11300, you can get the integration key under Admin > Integrations > Integration Key > New
- Please use an integration key with admin privilege, as there wont be any role based permission issues.
![](https://pitstop.manageengine.com/galleryDocuments/edbsn9ba350ffb264d5a27d87301d0967370b61a18a23eaf73c12e5d02fc4b3f39dc7f6b7ee126df89d2bbbf1bd0ce56a05f4?inline=true)
- For builds prior to 11300, refer https://help.servicedeskplus.com/api/rest-api.html$key and update the technician key.
![](https://pitstop.manageengine.com/galleryDocuments/edbsneb1be433fec6470e922b0d72f227d322af9a70bdf44a77af05b48eba977d64d90935b1a6701a2b57e9a33cc98655113d?inline=true)
3. Goto Admin > Request Custom Function > Custom Function > New > Paste the addChangeWithResourceInfoInDesc.txt content and save it with a name
- Update the global function count according to your instance
![](https://pitstop.manageengine.com/galleryDocuments/edbsn7bd88f16ee3a1e4df6b5c2658c62c3841b6a317cf32a164abf23734f7443e45c004d73600be03606a6dc53b68a7fcc62?inline=true)
- Update the Change template name as per your instance. In my case its "Additional Field" template.
4. Configure the created custom function in a trigger to get executed every time a request is approved.