UI Action sets a different value than the one in the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 08:57 AM
Hello all,
I have encountered a very weird problem.
I created a simple UI Action called "Cancel". Here is the settings:
It works just as expected when I click on it. The conditions are also working just fine:
But when I say OK, then the script set it to Closed Complete, instead of the value I prescribed:
I have no idea why this is happening?
Thank you.
Best,
Firat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 09:04 AM
are you sure you are setting the correct choice value for that State field?
Usually state field is extended from task so you might be wrongly giving choice value from task table rather than your own table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 09:09 AM
Hello @Ankur Bawiskar ,
Here are the values:
I have also other buttons and they work perfectly fine. Only for this Cancel I have this weird problem.
Is it clashing with another UI Action possibly?
Best,
Firat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 09:10 AM
are you sure no before update business rule is changing the state from 104 to 3 ?
otherwise script looks good to me
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 09:29 AM
Good indication indeed!
I found that one BR that I created caused this issue.
Very weird, because in this BR what I do is the following:
I set active to False if the state is cancelled.
So, there is probably another BR that sets the state to closed complete because I set the active to false that comes from TASK table.
The reason I set this BR is because I want my custom records to be shown on "My Requests -> Closed Request " on the ESC when the state is Closed or Cancelled. My assumption was that this is shown on "Closed Request" list via active -> true/false flag but maybe I am mistaken.
Do you have any idea about this issue?
Thanks!
Best,
Firat