To Add UI Action Button in Employee Center
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
I want to add Copy Incident UI Action an addition dropdown in Actions Button in Employee Center, Please guide me how can I achieve that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @saha_1 ,
To add an one more action in those actions widget is not easy way.OOB widget Incident Standard Ticket Actions, you need to clone this widget and add the new button in the HTML code of this widget
<div>
<div class="dropdown" id="child-case-tabs" ng-if="data.showActions">
<button type="button" id="actions-button" class="btn btn-default dropdown-toggle action-btn" data-toggle="dropdown" style="width : 100%" aria-haspopup="true" ng-init="setFocusOnActionButtons()">
${Actions}
<span class="fa fa-caret-down"></span>
</button>
<ul class="dropdown-menu pull-right" id="actionList">
<li ng-if="data.canResolve">
<a href="javascript:void(0)" ng-click="$event.stopPropagation();resolveIncident()">${Resolve}</a>
</li>
<li ng-if="data.canReopen">
<a href="javascript:void(0)" ng-click="$event.stopPropagation();reopenIncident()">${Reopen}</a>
</li>
<li ng-if="data.canClose">
<a href="javascript:void(0)" ng-click="$event.stopPropagation();closeIncident()">${Close}</a>
</li>
<li ng-if="data.canCopy">
<a href="javascript:void(0)" ng-click="$event.stopPropagation();copyIncident()">${Copy Incident}</a>
</li>
</ul>
</div>
</div>
Like this and you can also need to write the code in the server side and the client side controller to perform action after clicking on that button.
Instead there is one more approach, you can make Action widget field empty of the following record 33ad80e787f10010e0ef0cf888cb0b87 (sys_id) and add the records in the standard ticket actions related how it is showing in the following image.
If my response helped, mark it as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
49m ago
Hello @saha_1 !
You can achieve it be creating a standard ticket action record in std_ticket_config_action table.
Code:
(function(inputs, outputs) {
var newInc = new GlideRecord('incident');
newInc.initialize();
newInc.short_description = current.short_description;
newInc.category = current.category;
newInc.insert();
outputs.messageType = 'info';
outputs.messageValue = gs.getMessage("Incident Copied!");
})(inputs, outputs);Note: Add more fields that you want to copy from current incident.
Sample Output:
Before Clicking the button:
After clicking the button:
Hope this will be of help for you!
Regards,
Alfrin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
46m ago
please use approach suggested by other members and proceed
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
