Collecting Array information from from an API and adding to another API

Hello,

I am currently working on an automation project.

Background:
Currently, supervisors raise Service Now ticket to add new users to GC, than it routes to NOC team for creating those profiles manually. Which sometimes takes a week+ of time depending on NOC resource availability to create those accounts.
This is not a good experience for the supervisors to wait that long.

Automation:
This will enable Contact Center supervisors to automatically create user (Agent or Supervisor) profiles based on their requirement.
There could be multiple ways to create IDs on Genesys.
But I want to do it in a controlled environment.

How: there are 2 ways that I can think of one is either they visit a website (with authetication & validation) and start chatting with the user ID creation bot or through Service Now Integration with a Genesys API.

The digital bot/servicenow will be asking whether they want to mirror/copy existing users settings or start fresh.
If they say copy current user, I am currently collecting UserID based on email using data action and then creating the users and assigning them with same titles and department and division. So far all good.
The problem is in copying all the roles. Because existing users may have array of roles like (Users, Supervisors, Mindful Access, etc) I am able to get all the users role, but that shows in a list format. [by using GET API: /api/v2/authorization/subjects/${input.subjectId}]
How can I assign all those roles to new users using a data action all at once? is there a possibility?

I am ABLE to do so on the DEV center using another
API: POST
/api/v2/authorization/subjects/{subjectId}/bulkadd

But unable to create a data action which can add array or roles with respective division to a user.

image

@Jason_Mathison i was watching some of your devcast. Very helpful and informational.
Can you please help on both the topics that I have raised today when you get enough time. Thanks.

Sorry for the delayed response,

What exactly is going wrong when you try to do this with a data action?

--Jason

Ask is, if I use [ GET API: /api/v2/authorization/subjects/${input.subjectId}] I want to get the list items in different variables like Role1, Role2, Role3, and so on, is that possible.
So that when we assign role to users, I can use those variables.

in short, I need to copy-paste roles/divisions from one user to another user using APIs.

In test mode can you provide the output of the "Execute" step? That is the actual output from the endpoint prior to any processing done by your data action.

--Jason

@Jason_Mathison example screenshot is on the first post. It shows 2 roles users & supervisors.

Other problem is, if I have to copy paste roles and respective divisions, there could be instances for e.g. some users may have 5 roles (say, User, Supervsiors, Evaluator, Calibrator, Prompt (custom))

but some may have just 2 or 3 or 7 or 8 as well. which we may have to copy to new users.

Crap, I edited a previous comment instead of making a new one :slight_smile:

Please post the results of the execute step of your action, with anything sensitive redacted.

--Jason