- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2023 12:29 PM
Hello Everyone,
My Incident form contains a Related Link "Add Multiple Observables" so when users click "Add Multiple Observables", a window will pop up to enter a phrase. It works fine, but I also want to add the same Popup window when my analysts change the ticket status from Draft to Assigned.
The UI Action contains the following script:
=========================
function openObservableTextArea () {
var sysId = g_form.getUniqueValue();
var title = getMessage("Add Multiple Observables");
var dialogClass = GlideModal ? GlideModal : GlideDialogWindow;
var dd = new dialogClass("sn_si_add_bulk_observables");
dd.setTitle(title);
dd.setPreference('sysparm_sys_id', sysId);
dd.setWidth(450);
dd.render();
}
========================
Could someone give me some hits on how I can call that UI Action when I changed the ticket status?
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2023 01:08 PM
As I mentioned, you will need to create an onChange Client Script that run when your status field changes, and validates if the newValue is Assigned (you can even validate oldValue if that must be Draft).
If you don't want the Modal to trigger immediately when the status field is changed on the form, you can have the script run "onSubmit", i.e. when the form gets saved, but inn that case you need to get the value of your status field specifically in the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2023 08:15 AM
I know this thread is a little old, but I have been beating my head on the wall with this one. I'm working in a Vancouver PDI that is brand new with demo data. I'm trying to run either a Catalog UI Policy or Catalog Client Script that triggers on State change. I have come across extensive amount of documentation indicating to set them to trigger on State change from the condition selector (UI Policy) or changed variable (UI Script); however, I only have access to the custom variables on the Catalog Item via these methods. There is no option to monitor the state in either scenario. Why is it that I cannot see anything else in the condition/variable selectors for the Catalog Item I'm working with when I see everyone else's examples with screenshots showings it's possible?!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2023 12:45 PM
Consider moving your code into a UI script that you would call from your UI action and also from an onChange client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2023 12:51 PM
after it was moved to a UI Script, what can I do to call it when the ticket status has been moved from Draft to Assigned?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2023 01:08 PM
As I mentioned, you will need to create an onChange Client Script that run when your status field changes, and validates if the newValue is Assigned (you can even validate oldValue if that must be Draft).
If you don't want the Modal to trigger immediately when the status field is changed on the form, you can have the script run "onSubmit", i.e. when the form gets saved, but inn that case you need to get the value of your status field specifically in the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2023 08:15 AM
I know this thread is a little old, but I have been beating my head on the wall with this one. I'm working in a Vancouver PDI that is brand new with demo data. I'm trying to run either a Catalog UI Policy or Catalog Client Script that triggers on State change. I have come across extensive amount of documentation indicating to set them to trigger on State change from the condition selector (UI Policy) or changed variable (UI Script); however, I only have access to the custom variables on the Catalog Item via these methods. There is no option to monitor the state in either scenario. Why is it that I cannot see anything else in the condition/variable selectors for the Catalog Item I'm working with when I see everyone else's examples with screenshots showings it's possible?!