Create a custom button and a custom field - clicking on the button should populate the custom field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2025 07:15 AM
I have a requirement to Create a custom button and a custom field.
clicking on the button should populate the custom field with the count of incidents assigned to the given assignment group
Help me with this.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2025 09:26 PM
Hi @KarangulaB
Try the below solution.
1. Custom string field:
2. Custom UI action:
var records = new GlideRecord('incident');
records.addQuery('assignment_group', current.assignment_group);
records.addQuery('state', '!=', 7); // 7 is the state for 'Closed'
records.query();
current.u_incident_count = records.getRowCount();
current.update();
action.setRedirectURL(current);
Modify the script as required.
Regards,
Siva