State Field showing incorrect State

Mudit4
Kilo Expert

I have defined a Change Model consisting of:

Scheduled ->Implement, Pending Customer

Pending Customer-> Scheduled, Implement

Implement-> Review, Pending Customer

When I transition my change request into Pending Customer State, The state field shows 'Scheduled'. On checking the state in the List of change requests, the state is Pending Customer. Also, when the request is first loaded it shows Pending customer but Changes to 'Scheduled'

What is happening. I know the request is in pending state but why does the state value change to Scheduled.

find_real_file.png

But on opening-> State value initially is Pending but switches to "scheduled" on loading

find_real_file.png

1 ACCEPTED SOLUTION

Yes it is a custom state. I created it by following the same documentation you mentioned. I still dont know why the problem occured. But somehow it got resolved over the weekend without me making any changes

View solution in original post

14 REPLIES 14

Saurav11
Kilo Patron
Kilo Patron

Hello

Please check if there is any onload script written in the cakgrnd for state field

Hi Saurav,

I am pretty new to ServiceNow. Can you tell me where to find the script?

 

Hi Saurav, I couldnt find any specific Client Script that is doing that . I do have all the default scripts active for Change though

Mudit4
Kilo Expert

Okay I think I have found the problem. The State Fields default is the first choice available.

How can I set the default Value of state field according to the current State the request is in.

Currently, default Value is 1

find_real_file.png

Can Someone Suggest a Script that i can write here to automatically choose the current State?