Obtain list of email addresses from RoleID (equiv of Teams list in ticketing) | XM Community
Skip to main content

Hi All,
Has anyone found a way to retrieve the list of users email addresses that are associated to a team / role? My idea is to setup an email task in a workflow when a subticket is created but to email the individuals that belong to a team / roleID that the subticket has been assigned to. I don't want the subticket assigned to a specific person.

I couldn't find a API call in the list so I started inspecting the webpage when you click on a team / Role to see what POST and GET commands but it's not obvious to me how it's retrieves the details.

Has anyone had a look at this before. Do you think it's possible?

Thanks

Rod Pestell

For example, I have a team / role called GE_Test which contains to users (ie 2 email addresses). I'd like to retrieve the two emails so that I can then plug them in via some piped text in a workflow task to send an email to them both.

As you can imagine, my reasons for trying to make this dynamic is that I have many groups and so creating many individual workflows for each group is not really do-able.

image.png
when you click on GE_test and listen to what's going on in the developer window yuo can see this activity (apologies teh screen shot below is for a group with 7 users in). So the call (whatever it is) send back 7 UR_ bits(?!) of info with the details in, including the email address. I'm at first trying to work out what I need to POST or GET via a webservice task that will send back these UR_codes so that then maybe via a code task I can then parse the email addresses and combine them.

image.png

A little bit of an update, I've managed to find the URLs which returns the list of Roles and Users and then the Users details.

https://your_brand_id>.qualtrics.com/roleservice/v2/roles?contextId=CX
This sends back a JSON file which gives all the ROL_ (team /role) IDs and the users that make up that team:
image.png
I'm able to obtain via piped text what's known as the Team value (ROL_......) and the Team Label (the name of the team / role). So with this info, I'm assuming it's then possible to grab the username details

https://.eu.qualtrics.com/tickets/v1/UDS/user/UR_0qUxxxxxxxxxx

and this returns another JSON string in the browser:
{"userId":"UR_0qU1ezxxxxxxxxx","userName":"email@yourdomain.co.uk","orgId":"yourbrand","firstName":"name","lastName":"name","email":"email@yourdomain.co.uk","accountType":"UT_2c6FLGoxxxxxxx"}

So is there a way to collect / GET the information needed using a script / code task / webservice so that I can then use the email addresses in an email task so that I can send out an email to the team members belonging to a team / role that have been sent a sub ticket?

I realise this is all done in a browser session and so I am hoping this can be migrated to a code task or webservice using API and my API Token. I hope the point I've reached is a good start and someone can help me from this point on to progress this.

A little more research and I came across this python script (https://api.qualtrics.com/guides/ZG9jOjg3NzY3NQ-managing-users) which looks like it could be utilised for parsing JSON data retrieved from an API call. This is all fine except that I assume Qualtrics will not run a python script and the only way I can get the data is via the Webservice task so my main challenge is how I turn all my web browser based method into an API or similar call which will work within the remit that Qualtrics provides?

Thanks

Rod Pestell


Hi All,
Any advice on this would be great. This is no doubt a challenge but this would most certainly be a game changer in terms of emailing customised messages and allowing head of departments to review their list of teams in their group without the need for admin access.
Thanks
Rod Pestell


Leave a Reply