Issue Encountered in Scheduled Job: Incorrect RITM State and Resolution Notes

andreea_luca
Tera Contributor

Hi, in a Scheduled Job, I'm trying to create an RITM which is the parent of other RITMs. The problem is that even though I set the state to "New," when I execute the code, the RITM is created, but the state is "Closed Skipped" with resolution notes stating "Refused from wishlist." Why is this happening?

 

This is how the code looks like:

     var reqItemGr = new GlideRecord('sc_req_item');
     reqItemGr.initialize();
     reqItemGr.cat_item = "loremIpsum";
     reqItemGr.request = "";
     reqItemGr.business_service = "loremIpsum";
     reqItemGr.assignment_group = "loremIpsum";
     reqItemGr.opened_by = "";
     reqItemGr.short_description = "loremIpsum";
     reqItemGr.opened_at = new Date();
     reqItemGr.state = 1; //TODO: check why it is inserted with Status Closed Skipped
     reqItemGr.insert();
3 REPLIES 3

Mark Manders
Mega Patron

Can you share the code so we can see what you are doing? We don't have access to your instance, so any answer is a guess.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I edited the question.

Mark Manders
Mega Patron

If it is created on a different state, there must be code in your instance setting it to that. Are you sure it is inserted as closed skipped, and not set after insert?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark