- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2018 08:10 PM
So I am new to the Service Desk Call option,
I was able to get the Incident information the way I want, now I wanted to create a General Request item - I have tried using the format of
New call to create generic request`
However it just isnt copying any of my data from the NewCall to the request/item and not actually submitting the request.
Would anyone be willing to share their experiences/code?
basically i want to take
short_description to task short description
description to task description
caller to task requested for
assignment group to task assignment group
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2018 03:54 AM
HI William,
Check this out:
createServiceRequest();
function createServiceRequest() {
var cart = new Cart();
var item = cart.addItem('af695d47314610003e55ce5fcb8deb06');
cart.setVariable(item, 'short_description', current.short_description);
cart.setVariable(item, 'description', current.description);
cart.setVariable(item, 'sr_cmdb_ci', current.cmdb_ci);
cart.setVariable(item, 'sr_resolver_group', current.assignment_group);
var cartGR = cart.getCart();
cartGR.requested_for = current.u_affected_person;
cartGR.update();
var newSerReq = cart.placeOrder();
newSerReq.opened_by = current.caller_id;
newSerReq.update();
var activityLogMsg = 'Your Incident ' + current.number + ' has been cancelled and a Service Request ' + newSerReq.number + ' is created. No action is needed on your part';
current.state = 5;
current.active = false;
current.work_notes = activityLogMsg;
current.parent = getRITM(newSerReq.sys_id);
current.update();
var disMessage = 'Incident ' + current.number + ' has been cancelled and your work will be captured via the newly created Service Request ' + newSerReq.number;
gs.addInfoMessage(disMessage);
action.setRedirectURL(newSerReq);
action.setReturnURL(current);
}
function getRITM(serReq) {
var ritm = '';
var grRITM = new GlideRecord('sc_req_item');
grRITM.addQuery('request',serReq);
grRITM.query();
if(grRITM.next()) {
ritm = grRITM.sys_id;
}
return ritm;
}
Regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2018 06:47 AM
Hi Will,
Can you explain more on this. What you want to set and in which field i am confused on this.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2018 07:06 AM
I want to set the transferred_to field on the Table "Call" to the new Request Number
If you look at the Servicedesk / New Call feature it generates a Request Number within the Transferred To field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2018 04:58 AM
Check out this post for help: Re: Copy New Call Description into Request Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2018 08:01 AM
Mike,
Thanks for this information! it was helpful.
I am trying now to make the business rule write to the new_call table for the field transferred_to to display the request.number, possible can you point me in the direction of a script or something that would accomplish this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2018 12:41 PM
There is a business rule that comes out of the box: Link back to the call that generated it