The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How can we change state as canceled?

Community Alums
Not applicable

Hello,

I would like to know about how can i change the state on incident form as canceled when user click on cancel ui action.

I created ui action - Cancel and action name - u_cancel 

And for state I wrote script -

current.setValue('u_cancel' , 'canceled');

current.update();

But it is not working. 

Thank you

 

 

 

1 ACCEPTED SOLUTION

Hi. Mark as Correct if it helped you resolve the issue. Thanks


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

View solution in original post

9 REPLIES 9

Martin Ivanov
Giga Sage
Giga Sage

just put 8 instead of 'canceled'

see the reference

Mark Correct AND Helpful. Thanks!

find_real_file.png


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

Community Alums
Not applicable
I did it too but nothing is happening.

yes, you have to put the value in the state field.

so, rewrite this line to:

current.setValue('state', 8);


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

Community Alums
Not applicable
I also wrote it but I didn't receive the output.