Error on Flow Designer - class java.lang.Long cannot be cast to class org.json.simple.JSONObject

Community Alums
Not applicable

Hi,

I have created a flow to submit a catalog request when ci status changed.

Trigger condition works fine but 'submit Catalog Item Request ' action on the flow throws error message

 

Flow Designer: class java.lang.Long cannot be cast to class org.json.simple.JSONObject (java.lang.Long is in module java.base of loader 'bootstrap'; org.json.simple.JSONObject is in unnamed module of loader com.snc.orbit.container.tomcat8.Tomcat8$OrbitTomcat8ClassLoader

 

I have created few flow variables(String Type) and set the value from cmdb record.

and passing the values to the action 'submit Catalog Item Request'.

 

after the execution i can see the above error message.

Please help to identify the cause of the error and how to fix the issue.

 

 

1 ACCEPTED SOLUTION

@Community Alums 

Glad to know that my response helped and worked.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Sandeep Rajput
Tera Patron
Tera Patron

Please check if you are providing correct inputs to Submit Catalog Item Request action, error may appear if the inputs provided to this action is not correct.

Community Alums
Not applicable

Hi Sandeep,

Thanks for your reply.

 

The issue with the catalog variable 'Asset State '.

 I need to capture the 'install state' of the hardware asset and pass it to the request Item action (variable 'Asset state') . 

Please guide me how can we map the choice field  to catalog item variable.

I cannot map the asset state field to catalog variable in the 'Submit Request Item' action

 

TamilselvanPar_0-1698319202490.png

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

the error clearly says issue of field type

your variable is of what type?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

@Ankur Bawiskar @Sandeep Rajput 

 

Thanks for the hint,

Yes i found the field and it was String Type and asset state is a choice field.

I made the changes accordingly and now it is working fine.