- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 12:42 AM
After selecting Closure Code there's one more field Closure Issue type | u_issue_type_by_category (reference field)
after selecting particular option , we need to trigger a particular Catalog service request
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2024 09:45 AM
@roshan_shetty10 You may try the below steps to achieve it.
1. Create an "After" update business rule.
2. In Advanced section, add the below script to achieve creation of a request based on the resolution code.
(function executeRule(current, previous /*null when async*/) {
var conversionMessage = '';
var sysidOfItem = '039c516237b1300054b6a3549dbe5dfc'; //For e.g Access Catalog Item
var cartId = GlideGuid.generate(null);
var cart = new global.Cart(cartId);
var item = cart.addItem(sysidOfItem);
var assignmentGrp = current.getDisplayValue('assignment_group').toLowerCase();
cart.setVariable(item, 'requested_for', current.caller_id);
cart.setVariable(item, 'requested_by', current.opened_by);
cart.setVariable(item, 'catalog_item', '039c516237b1300054b6a3549dbe5dfc');
//Set for other variables similarly
var req_num = cart.placeOrder();
conversionMessage += 'Request ' + reqItem.number + ' created.<br />';
setGroup(req_num.sys_id);
function setGroup(reqID) {
var assignmentGroup = current.assignment_group;
var assignedTo = current.assigned_to;
var reqItem = new GlideRecord('sc_req_item');
reqItem.addQuery('request', reqID);
reqItem.query();
if (reqItem.next()) {
reqItem.parent = current.sys_id;
reqItem.comments = "Incident : "+ current.number +" has been converted as 'Request': " + reqItem.number;
reqItem.update();
}
}
})(current, previous);
3. Now on closure/resolution of the incident, a request is created.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2024 09:45 AM
@roshan_shetty10 You may try the below steps to achieve it.
1. Create an "After" update business rule.
2. In Advanced section, add the below script to achieve creation of a request based on the resolution code.
(function executeRule(current, previous /*null when async*/) {
var conversionMessage = '';
var sysidOfItem = '039c516237b1300054b6a3549dbe5dfc'; //For e.g Access Catalog Item
var cartId = GlideGuid.generate(null);
var cart = new global.Cart(cartId);
var item = cart.addItem(sysidOfItem);
var assignmentGrp = current.getDisplayValue('assignment_group').toLowerCase();
cart.setVariable(item, 'requested_for', current.caller_id);
cart.setVariable(item, 'requested_by', current.opened_by);
cart.setVariable(item, 'catalog_item', '039c516237b1300054b6a3549dbe5dfc');
//Set for other variables similarly
var req_num = cart.placeOrder();
conversionMessage += 'Request ' + reqItem.number + ' created.<br />';
setGroup(req_num.sys_id);
function setGroup(reqID) {
var assignmentGroup = current.assignment_group;
var assignedTo = current.assigned_to;
var reqItem = new GlideRecord('sc_req_item');
reqItem.addQuery('request', reqID);
reqItem.query();
if (reqItem.next()) {
reqItem.parent = current.sys_id;
reqItem.comments = "Incident : "+ current.number +" has been converted as 'Request': " + reqItem.number;
reqItem.update();
}
}
})(current, previous);
3. Now on closure/resolution of the incident, a request is created.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2024 11:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2024 10:02 AM
You can do this in flow designer when the particular option selected would be your trigger against the table in flow and then follow it up with an action to submit the service request