- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2015 06:36 PM
Hi, I am trying to create a "copy incident" button that will copy all the completed fields except caller and impacted user to a new incident. This will be used when we have multiple copies of the same request for different people. I was able to get te button to display but when I click on it, it doesn't do anything. Here is my code, any help woul be greatly appreciated.
var newinc = new GlideRecord('incident');
newinc.initialize();
newinc.short_description = current.short_description;
newinc.u_requested_by = current.u_requested_by;
newinc.u_requested_for = current.u_requested_for;
newinc.assignment_group = current.assignment_group;
newinc.assigned_to = current.assigned_to;
newinc.description = current.description;
newinc.u_business_impact = current.u_business_impact;
newinc.category = current.category;
newinc.u_service_affected = current.u_service_affected;
newinc.u_service_impact = current.u_service_impact;
//newinc.incident_state = current.incident_state;
newinc.severity = current.severity;
newinc.impact = current.impact;
newinc.priority = current.priority;
newinc.insert();
gs.addInfoMessage('Incident ' + newinc.number + ' created.');
action.setRedirectURL(newinc);
action.setReturnURL(current);
2nd shot below is picture of form with button on it
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2015 10:10 PM
For your reference, this works.. Attaching the xml of the ui action and a screenshot for your reference

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2015 10:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2015 08:49 AM
Thank you for your assistance. I think I was making a very stupid mistake` Although I put the code in the UI action. I never saved the code. As soon as I hit save and then update it started working.
Thank you all for your assistance, if you didn't reply I wouldn't have rechecked it and found out what was causing the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2016 10:39 AM
Hello,
Will this work on Geneva? I tried the above script and I didn't get a copy button.
Please advise.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2015 11:30 AM
to this script all the fields in incident are coping. but i want only some fields like caller id, location, short description, mobile number, email id only. what will i do.by removing the extra fields in script i didnt got the output