- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 07:24 AM
Hi
I am looking to create an automation where our User Management team can create an incident to report that a user has left the company. My thoughts were create a button on the User form which can be clicked which does the following:
- Creates a new incident
- Sets the Caller to the users name
- Sets Category and sub category
- Populates the Configuration item to the users assets (Each CI has the assigned to field populated with a users name)
- Enters details into the description field
I have already created the button on the user form but i am unsure how to complete the above actions
Any guides or advise is welcome
Thank you in advance
Adam
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 07:39 AM
Bit modification:)
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('assigned_to',current.sys_id);
gr.query();
gr.next();
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.sys_id;
inc.category = 'addyourcategory';
inc.subcategory = 'addyoursubcategory';
inc.cmdb_ci = gr.sys_id;
inc.short_description = 'addyourdescription';
inc.insert();
action.openGlideRecord(inc);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 07:36 AM
Hi Adam,
Try below
var gr = new GlideRecord('alm_asset');
gr.addQuery('assigned_to',current.sys_id);
gr.query();
gr.next();
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.sys_id;
inc.category = 'addyourcategory';
inc.subcategory = 'addyoursubcategory';
inc.cmdb_ci = gr.sys_id;
inc.short_description = 'addyourdescription';
inc.insert();
action.openGlideRecord(inc);
Thank you
Prasad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 07:39 AM
Bit modification:)
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('assigned_to',current.sys_id);
gr.query();
gr.next();
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.sys_id;
inc.category = 'addyourcategory';
inc.subcategory = 'addyoursubcategory';
inc.cmdb_ci = gr.sys_id;
inc.short_description = 'addyourdescription';
inc.insert();
action.openGlideRecord(inc);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2022 07:47 AM
Need to create a UI action to resolve RPA server restart incidents with just one click?
Clicking on the UI action, would fill out the following fields with below values and so this
would resolve the incident with one click:
-Assign to:
-Impacted Business Service:
-Cause code:
-Closure notes:
-Status: resolved
-Sub state: Self Recovery
can you please help with script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 07:38 AM
Hi you can write below code in UI Action script:
var incGr = new GlideRecord('incident');
incGr.initialize();
incGR.caller_id = current.user_name // you can write appropriate field name
< write code for other requirements >
incGR.insert();
var url = '/incident.do?sys_id=-1';
window.open(url,'_blank'); // if you want to open incident in same window then use self instead of blank