Activity set and activity not visible in the HR Agent workspace playbook.

Kalyani35
Tera Guru

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!

1 REPLY 1

Amit Gujarathi
Giga Sage
Giga Sage

HI @Kalyani35 ,
I trust you are doing great.

  1. Navigate to the HR agent workspace.
  2. Click on the "Configuration" icon in the left navigation pane.
  3. Under the "Workspaces" section, select "HR Agent Workspace" to open its configuration.
  4. In the HR agent workspace configuration, click on the "Design" tab.
  5. Locate the section where you want to display the approval's activity set. This could be a form, a section, or a widget.
  6. Click on the section or widget to edit its properties.
  7. In the properties panel, find the "Visible Activities" or a similar setting. This setting determines which activities are displayed in the workspace.
  8. 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.
  9. 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