Activity set and activity not visible in the HR Agent workspace playbook.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2023 08:54 PM
Hi experts,
I have created an approval in a activity set as part of a flow in a lifecycle event. The approval gets generated and visible on native UI. However in HR agent workspace it is not visible.
I have a requirement where approval is conditional and should be generated based on a variables value. That is the reason why chose to create a separate activity set and flow to create a conditional approval.
Does anyone know what could be done to make the approval's activity set visible in workspace.
Thanks!
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 12:14 AM
HI @Kalyani35 ,
I trust you are doing great.
- Navigate to the HR agent workspace.
- Click on the "Configuration" icon in the left navigation pane.
- Under the "Workspaces" section, select "HR Agent Workspace" to open its configuration.
- In the HR agent workspace configuration, click on the "Design" tab.
- Locate the section where you want to display the approval's activity set. This could be a form, a section, or a widget.
- Click on the section or widget to edit its properties.
- In the properties panel, find the "Visible Activities" or a similar setting. This setting determines which activities are displayed in the workspace.
- Add the sys_id of the activity set associated with the approval to the "Visible Activities" field. This will make the activity set visible in the HR agent workspace.
- Save the changes and close the configuration.
Here's an example of how you can add the activity set to the "Visible Activities" field using GlideRecord API in a scripted solution:
// Find the sys_id of the approval's activity set
var activitySetName = 'Your Activity Set Name'; // Replace with the actual name of the activity set
var activitySetGR = new GlideRecord('sn_hr_core_activity_set');
activitySetGR.addQuery('name', activitySetName);
activitySetGR.query();
if (activitySetGR.next()) {
// Get the sys_id of the activity set
var activitySetSysId = activitySetGR.getValue('sys_id');
// Add the activity set sys_id to the HR agent workspace configuration
var workspaceGR = new GlideRecord('sn_hr_core_agent_workspace');
workspaceGR.addQuery('name', 'HR Agent Workspace');
workspaceGR.query();
if (workspaceGR.next()) {
var visibleActivities = workspaceGR.getValue('visible_activities');
visibleActivities += ',' + activitySetSysId; // Add the activity set sys_id to the existing visible activities
workspaceGR.setValue('visible_activities', visibleActivities);
workspaceGR.update();
}
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi