Script not working in UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2024 05:12 AM
I am facing an issue while running the script in UI action. The client side script is executed but the server side script is not getting executed even if i use gsftSubmit().
Here is the code:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2024 10:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2024 11:13 PM
Please try with below code:
function alertUser() {
if (confirm("Are you sure you want to create a child incident of the current incident?")) {
// Trigger the server-side script to create the child incident
createChildIncident();
}
}
// Function to create a child incident
function createChildIncident() {
var newIncident = new GlideRecord('incident');
newIncident.initialize();
newIncident.caller_id = current.caller_id;
newIncident.parent_incident = current.sys_id;
newIncident.short_description = current.short_description;
newIncident.insert();
// After creating the child incident, redirect the user back to the parent incident
action.setRedirectURL(current);
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2024 04:44 AM
It is not working same issue is coming, client side script is getting executed but the server side script is not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 12:01 PM
Hi @Akshat2404 ,
Did you update Action name--->"Create_incident" in UI action?
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda