Need to fetch approval details in a widget with assignment group name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 07:28 AM
I have created a widget where i am fetching a approver name , state and assignment group name .
I am able to fetch the approver name and state but it's not fetching the group name when it is going to group approval
Please find below script for refrerence
HTML:
<div ng-if="c.data.table == 'sc_req_item'" class="panel b">
<div class="panel-heading bg-primary">Approvals</div>
<div class="panel-body">
<table class="table table-striped table-responsive" ng-if="data.approvals.length">
<thead>
<tr>
<th ng-repeat="field in data.fields_array track by $index">
<div class="th-title">{{field.label}}</div>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in data.approvals track by item.sys_id">
<td class="pointer" ng-repeat="field in data.fields_array" data-field="{{field}}" data-th="{{field.label}}">
{{item[field.name]}}
</td>
</tr>
</tbody>
</table>
<div ng-repeat="item in data.approvals track by item.sys_id" class="nested-approvals">
<div ng-if="item.sub_approvals.length">
<h5>Sub-approvals for {{item.approver}}:</h5>
<table class="table table-striped table-responsive" ng-if="item.sub_approvals.length">
<thead>
<tr>
<th ng-repeat="field in data.fields_array track by $index">
<div class="th-title">{{field.label}}</div>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subItem in item.sub_approvals track by subItem.sys_id">
<td class="pointer" ng-repeat="field in data.fields_array" data-field="{{field}}" data-th="{{field.label}}">
{{subItem[field.name]}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Server Script: