Currently, every time one has to update a field with values, they need to adhere to a specific format, which can be challenging as not everyone is familiar with it. To simplify this process, we propose a generic function that can handle the formatting automatically.
Instead of remembering complex formats, users can simply provide values in a straightforward structure like this:
{ "category": "Hardware",
"udf_sline_301": "Shawn Adams",
"priority": "High",
"scheduled_start_time": "1734500415037",
"resolution": "Sample resolution"
}
This input will be parsed and converted into the required format:
{ "request": {
"udf_fields": {
"udf_sline_301": "Shawn Adams"
},
"category": {
"name": "Hardware"
},
"priority": {
"name": "High"
},
"scheduled_start_time": {
"value": "1734500415037"
}
"resolution": {
"content": "Sample resolution"
}
}
}
By using this function, the need to remember or manually structure the field formats is eliminated, making the process faster and more user-friendly.
This function will work only if the provided keys adhere to the allowed format. Refer to the documentation for the correct attribute names: ManageEngine API Documentation.
We need to configure a module-level custom function to update the entity by calling the global function to automatically format the user-provided input and use the formatted data for the update.
The custom functions for the Change module and Request module are attached as samples. Configure these functions in custom triggers, and set the invoking conditions based on your requirements.
Request Module Configuration for reference
Request Custom Function:
Request Custom Trigger:
Request Module Configuration for reference
Change Custom Function:
Change Custom Trigger: