- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 04:15 PM - edited 01-29-2024 04:17 PM
Hello All,
Does anyone know if it's possible to copy and insert a field's value into another field within a UI Action? For example, in the following script, I'd like to copy the current incident number and input it into the field "Original Incident Number", within the new incident that is being created. Essentially this UI Action will enable our users to duplicate incidents but we want to keep track of the original incident number on the new incident for reference.
The UI Action runs as expected and creates the new incident record, but the "Original Incident Number" (which is a reference field), is still empty.
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 07:42 PM
Hi @JW22 ,
after changing
current.u_original_incident_number = current.number
to
current.u_original_incident_number = current.sys_id.toString();
u_original_incident_number field will be populated with value.
I tested in my PDI, please check the screenshots below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 04:23 PM
Hi,
try changing your line to
current.u_original_incident_number = current.sys_id.toString();
since the 'u_original_incident_number' field is a Reference field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 04:55 PM
Thanks for your help! Unfortunately no luck with that change, the 'Original Incident Number' field is still empty on the new incident that is created from the UI Action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 05:42 PM
There is several OOB 'Create Incident' UI Actions. Refer to those as examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 07:42 PM
Hi @JW22 ,
after changing
current.u_original_incident_number = current.number
to
current.u_original_incident_number = current.sys_id.toString();
u_original_incident_number field will be populated with value.
I tested in my PDI, please check the screenshots below: