how to clear subcategory when category changed in through API

Hareesha
Tera Contributor

Hi, I have 2 serviceNow instances integrated bidirection. When i am changing the category in first instance and leaving subcategory as empty, in second instance category is getting updated and subcategory is not changing to blank instead it is holding previous value. can anyone help me on this?

 

Thanks!

4 REPLIES 4

Vrushali  Kolte
Mega Sage

Hello @Hareesha ,

 

Please make sure you are sending the subcategory value as empty (subcategory='') in the request body.

 

If my answer solves your issue, please mark it as Accepted✔️ and Helpful 👍based on the impact.

 

 

Amit Verma
Kilo Patron
Kilo Patron

Hi @Hareesha 

 

Could you please elaborate how this integration has been achieved ? I assume it is via REST API calls. If yes, please check what payload is being sent to the target instance from the source instance. I assume the payload is only taking changes and sending it across, that's why only changed fields are getting updated.

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Hi @Amit Verma ,

 

Yes, i can see in payload that subcategory value is not sending empty. Its sending previous value. How can i fix this?

@Hareesha 

 

You need to look into the code where the payload is being created. While constructing the payload, you need to see what all fields are being queried for change. If possible, can you share the code or the logic by which the payload is being created ?


Please mark this response as correct and helpful if it assisted you with your question.