mandatory field in catalog item in service portal issue

Codi
Tera Contributor

Hi guys,

we encountered an issue in the ticket created via service portal. What happened is when this ticket was created one of the mandatory field in catalog item is blank. So the problem is we cannot change the state of the ticket since they are asking for the value of the mandatory field.

1 ACCEPTED SOLUTION

Hi @Codi 

 

I assume its a drop-down

 

There is one way...!! check if it works for you...!!

 

Open the form - 

press below keys on keyboard , don't remove your fingers from button unless you press 'J' 

 

ctrl + shift + alt + j 

 

the below executer will open -- 

 

VishalBirajdar7_0-1695643990645.png

 

Write below code & click on "Run my code"  [upper right corner]

 

//use your variable backend name

//add one dummy option 

g_form.addOption('type of licence','test','test');
g_form.setValue('type of licence','test');

 

This will set the value to type of licence variable.

Now close the executor and save the form.

 

Let me know if this worked..!!

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

13 REPLIES 13

Vishal Birajdar
Giga Sage

Hi @Codi 

 

If mandatory fields are blank then it will prevent the submission of form i.e., to submit the form one need to provide all the mandatory fields in portal.

 

Can you check if there is any UI policy or client script running on RITM/SCTASK level which is removing the value of mandatory  field ?

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @Vishal Birajdar I already check the UI policy and client script under the catalog item but no conditions set for the mandatory field

Hi @Codi 

 

1.Check if "Reverse if false" on UI policy making any effect.

 

2.Can you check if Mandatory check on variable form itself.

VishalBirajdar7_0-1695641736442.png

 

3.Also check if there is any scripting on UI policy.

 

VishalBirajdar7_2-1695641854117.png

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @Vishal Birajdar upon checking everything is ok on the catalog item because the mandatory check box is already thick. The weird thing is the issue is only happening on the particular ticket and to the other tickets is working as expected. The challege right now is we cannot put a value to the mandatory field. Is there any way for us to put a value to the mandatory field?