How to change state of problem record to closed when it is not resolved state?

Masa4
Giga Contributor

I would like to change state to close when I get solution in the middle of supporting problem without worrying the state and processing state model.

Therefore I created the UI Action for changing state to closed.
But I get the error message and state is not changed when I click this button on the form.
ERROR MESSAGE: Invalid state transition. Can not update from state 'New' to state 'Closed' with given values.

Do you have good any ideas to implement this feature?

BR,

1 ACCEPTED SOLUTION

Then look for the entry where the table is "problem" open it; in the "State Transitions" related list pick the "Closed" state, open it and adjust "Enter Condition" to allow entering from as many states as you need to.

find_real_file.png

View solution in original post

15 REPLIES 15

Hemanth M1
Giga Sage
Giga Sage

Hi Masa,

Problem state model is not letting you change/skip the states directly,

if your closing the problem, try setWorkflow(false) in your UI action.

 

Thank you,

Hemanth

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Masa4
Giga Contributor

Hi Hemanth,

Thanks for your comments.

Yes I am thinking that is good idea and I'll try it.

Do you have the points to be careful of using setWorkflow(false) in UI Action for problem record?

BR,

yes, when your using setWorkflow(false) it will not trigger any business rules, workflows but its ok in your case since your directly closing the problem.

you could also cancel the workflow as well in the UI action: new Workflow().cancel(current);

 

if you find this response useful, mark it as correct.

 

Thank you,

Hemanth

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

-O-
Kilo Patron
Kilo Patron

Modify the state model to allow changing to state Closed without conditions.