- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 01:43 PM
Hello everyone!
We have a button on our all INC that allows us to create an SIR. However, the group that creates said SIR cannot read the SIR based on security permissions and cannot see the ticket in the related list. What I would like to do is simply have a note added to the INC if they create the incident that has "you have created SIR######" just so they can verify that the ticket was created.
Any help is appreciated!
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 06:45 AM - edited 12-14-2023 07:20 AM
Well then this is easy now! Love that for us.
function serverCreate() {
var securityIncident = new SecurityIncidentUtils().createFromIncident(current);
current.work_notes = "Security Incident [code]" + securityIncident + "[/code] was created";
current.update();
gs.addInfoMessage(gs.getMessage("Security Incident {0} was created", securityIncident));
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:12 PM
I guess this depends on what mechanism is being used to create the SIR ticket. If that mechanism can return add a work note to the incident ticket, that might be an option. Or if it can return values, it could return the SIR number which could be displayed in a modal window or on the incident form. Would need more information about how the button works, I think.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:18 PM
It's created by a UI action with a script. We (security and admins) can then see the ticket in the related lists.
function create() {
var answer = confirm("Are you sure you want to create a Security Incident?");
if (answer == true) {
gsftSubmit(null, g_form.getFormElement(), 'create_security_incident');
} else {
return false;
}
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
serverCreate();
function serverCreate() {
var securityIncident = new SecurityIncidentUtils().createFromIncident(current);
gs.addInfoMessage(gs.getMessage("Security Incident {0} was created", securityIncident));
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 06:37 AM
At a glance, that looks right to me. I would suggest adding some logging or running it through the script debugger to see where it's failing. What output are you getting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 06:39 AM
That is the code that is correct and is working. However, I don't know how to grab the SIR# and add it to a work note.
Thanks for the quick response.