Need to pass ritm field values to work flow which is calling from the script

Indup
Tera Expert

I am creating a request from inbound action. And I am creating corresponding ritm using business rule. In the business rule after creating the ritm, I am calling a workflow which is on requested item table. There is only one run script activity in the workflow. In that run script activity, I want the ritm number and requested for values in a scratchpad variable. Workflow is triggering but the related ritm number and requested for is not coming . I checked with log messages also. Can someone help me here. It's a bit urgent

For my code, please see this link

https://community.servicenow.com/community?id=community_question&sys_id=b1745ecd1b946410305fea89bd4bcb41

 

 

Regards,

Indup

21 REPLIES 21

var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem(<sysid of catalog item>);

var rc = cart.placeOrder();
gs.addInfoMessage("Request Created " + rc.number);

current = rc;

current.u_title = email.body.title; // fields that you want to populate
.
.
.
current.update();
}

Tried with current = rc; but invain

My code:

find_real_file.png

and Cart here is [object Object] -----> does this mean cart has been created?

and "Item here is" log is giving this kind, i am not understanding those sys_ids. I checked in catalog items filter condition like sys id is .......

But showing empty records. Then what are those sys ids? Any way Request is not gettign created. Please can you help me. I amtrying to achieve this task since yesterday morining.

find_real_file.png

 

 

Regards,

Indup

Yeah, that's cart sys-id which will generate whenever you raise a request. it's working fine for me so I don't understand where things are going wrong.

Generally, this happens if catalog item has issues.
Can you directly raise that catalog item and see if RITM is generated

i will give credentials for my PDI. can you please implement it and show me. 

 

Regards,

Indup

Before that, can you explain the requirement for Inbound Action

Which emails should create request in system?

Why it is on request table?

I will follow each step so that I can provide you xml