+ * "This script should be placed as the last post function in the create transition in order to set the assignee field to the value of a user picker field.
+ * All right, title and interest in this code snippet shall remain the exclusive intellectual property of Adaptavist Group Ltd and its affiliates. Customers with a valid ScriptRunner
+ * license shall be granted a non-exclusive, non-transferable, freely revocable right to use this code snippet only within their own instance of Atlassian products. This licensing notice cannot be removed
+ * or amended and must be included in any circumstances where the code snippet is shared by You or a third party."
+// Specify the name of the list field to set
+def userPickerFieldName = "<UserPickerFieldNameHere>"
+// Get the Approver Custom field to get the option value from
+def customField = get("/rest/api/2/field")
+ (it as Map).name == userPickerFieldName
+// Check if the custom field returns a valid field and is not null
+assert customField != null : "Cannot find custom field with name of: ${userPickerFieldName}"
+// Get the issue object to get the field value from
+def result = get('/rest/api/2/issue/' + issue)
+ .header('Content-Type', 'application/json')
+// Get the accountID value from the Approver field
+def assigneeValue = result.body.fields.(customField.id).accountId
+//logger.info('Assignee Value is' + assigneeValue)
+def updateResult = put('/rest/api/2/issue/' + issue)
+ .header('Content-Type', 'application/json')
+ // Update the assignnee to the value of the approver field using the account ID so that the format is compliant with the upcoming GDPR changes.
+ assignee:[id:assigneeValue]