jilles.wielaard | 2021-05-31 10:49:30 UTC | #1
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
anon11147534 | 2021-05-31 15:08:37 UTC | #2
Hi,
If you have to make additional requests for every user then the best approach is probably to:
- Get a list of all userIds
- Iterate over each userId and make the requests to get their skills and queues. Append the output of this command to output.csv
system | 2021-06-30 15:08:39 UTC | #3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 11063