Need to display a Dialog Box with Yes / No to Create Problem Ticket for All Priority 1 incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2018 10:36 AM
The below Code has been created to Automatically create a Problem Ticket for all Priority 1 Incidents. But my requirement is a dialog Box to appear with Yes/No. If you click on Yes Pbm tickets gets created. Pls Help me where to insert the Yes/No code in the below give script.
-------------------------------------------------------------------------------------------------
(function executeRule(current, previous /*null when async*/) {
var short_description =current.getValue('short_description');
var gr= new GlideRecord('incident');
gr.addQuery("short_description", short_description);
gr.query();
var prob = new GlideRecord('problem');
while(gr.next()){
prob.short_description = current.short_description;
prob.impact = current.impact;
prob.urgency = current.urgency;
prob.company = current.company;
prob.setValue('location', current.location);
prob.setValue('cmdb_ci', current.cmdb_ci);
prob.setValue('u_vendor_company', current.u_vendor_name);
prob.setValue('u_vendor_ticket_number', current.u_vendor_ticket_number);
// prob.setCategory(current.category);
prob.setValue('u_category', current.category);
var sysID = prob.insert();
current.problem_id = sysID;
var mySysID = current.update(); // where is the mySysID being used??
}
var url = 'problem.do?sys_id=' + current.problem_id;
// gs.addInfoMessage("A Problem Ticket has been created " + prob.getValue('number'));
/* creating a URL link to the newly created Problem ticket */
gs.addInfoMessage('A Problem Ticket has been created: '+
"<a href='" + url + "'>" +
prob.getValue(prob.getDisplayName()) +
"</a>" + '.');
})(current, previous);
----------------------------------------------------------------------------------------------------------------
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2018 12:29 PM