- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 06:39 PM
Hello, this is Kentaro.
I have a question about the Incident table.
Is it possible to display a pop-up when an agent comments when the status is "Resolved"?
In the popup, I want to ask if I want to change the status back to "in progress."
Thanks,
Kentaro.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 08:24 PM
Hi, Thank you for replyng!
What should I set for Field name?
It doesn't seem to work unless you set the Field name.
If I set it to Additional comments, a popup will be displayed when entering a value in the text box.
When I want to execute the Client Script, it is after I press the Post button...
it's difficult...
Thanks,
Kentaro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 06:57 PM
Yeah, you can definitely set up a pop-up for when an agent comments on a resolved incident. Here’s how you can do it with a client script:
- Go to System Definition > Client Scripts and make a new Client Script.
- Set the Table to Incident and the Type to onChange.
- Add a script like this:
if (isLoading || newValue === oldValue) {
return;
}
if (g_form.getValue('state') === 'Resolved' && g_form.getValue('comments')) {
if (confirm("Do you want to change the status back to 'In Progress'?")) {
g_form.setValue('state', 'In Progress');
}
}
If the incident's state is "Resolved" and there are new comments, a pop-up will appear asking if you want to change the status back to "In Progress". If confirmed, the state changes to "In Progress".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 08:24 PM
Hi, Thank you for replyng!
What should I set for Field name?
It doesn't seem to work unless you set the Field name.
If I set it to Additional comments, a popup will be displayed when entering a value in the text box.
When I want to execute the Client Script, it is after I press the Post button...
it's difficult...
Thanks,
Kentaro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 08:43 PM
Instead of onChange you may want to use onSubmit, and check if the additional comments has been populated when they submit, though this doesn't work if you want it to be triggered when they post it. Outside of that, you'd have to customize the post button to include the logic, which I probably wouldn't recommend here.