Export skills and queues for each user in csv format

Hi,

I was asked to create a csv file with all the users and their skills(proficiency) and queues. I thought i could use the CLI tools for this and format the data wit jq. I managed to do this with the following command:

gc users list --expand skills --autopaginate | jq -r '.[] | [ .name, ([.skills[].name + "(" + (.skills[].proficiency | tostring) + ")"] | join("|")) ] | @csv' > output.csv

this will result in the following csv: username,skillA(1)|skillB(5)

unfortunately it is not possible to expand queues, so i need to make an additional request for every user to get their queues.

Is it possible to add this to the above command, so i can create a csv like this: username,skillA(1)|skillB(5),queueA|queueB

Hi,

If you have to make additional requests for every user then the best approach is probably to:

  1. Get a list of all userIds
  2. Iterate over each userId and make the requests to get their skills and queues. Append the output of this command to output.csv

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.