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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 09:31 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 11:01 PM
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();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 11:14 PM
Tried with current = rc; but invain
My code:
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.
Regards,
Indup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 11:40 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 11:51 PM
i will give credentials for my PDI. can you please implement it and show me.
Regards,
Indup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2020 01:15 AM
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