Expand my Community achievements bar.

Extracting whole User Names and Roles via API in Workfront

Avatar

Level 2

I am reaching out to inquire about the availability of an API that allows us to extract user names along with their respective roles for projects in our Workfront environment. I got one API https://*.my.workfront.com/attask/api/v15.0/user/search?fields=*,parameterValues:* but in that JobRole:Name is not showing in the response data
We are specifically interested in obtaining a dataset that looks like the following:-

Role                                        Names

Sr Front End DeveloperMitchell Cook
 Smith Rogers
 Willaims Morris
Principal Project ManagerAlex Turner
 Steve Parker
 David Cruz

 

or like this:-

Role Names

Sr Front End DeveloperMitchell Cook
Sr Front End DeveloperSmith Rogers
Sr Front End DeveloperWillaims Morris
Principal Project ManagerAlex Turner
Principal Project ManagerSteve Parker
Principal Project ManagerDavid Cruz


Could you please provide information on any existing API endpoints or methods that would allow us to achieve this?

Your assistance is greatly appreciated

3 Replies

Avatar

Level 9

Hi,

 

the Job role is a reference to another table in the WF database. So you need to in particular also for the role field.

 

 https://*.my.workfront.com/attask/api/v15.0/user/search?fields=*,role,parameterValues:*

should provide you with the necessary information.

Avatar

Level 2

You can try something like this:

{{Base_URL}}attask/api/{{API_Version}}/USER/search?fields=ID,name,emailAddr,username

 

That will give you the name, user and email

Hope it helps

Avatar

Community Advisor

If you need just 2 things, user name and their primary job role name you need this:

https://[domain].my.workfront.com/attask/api/v15.0/user/search?fields=name,role:name

 

please note that such basic call will return only 100 records by default

role is a collection, role name isn't returned by default so it has to be queried explicitly. Format of the output will be like this:

Rafal_Bainie_0-1698259690633.png

 

Alternative approach:
add custom field to a user called "Role name", it will be calculated field with this formula:

{role}.{name}

now your API query will look like this:
https://[domain].my.workfront.com/attask/api/v15.0/user/search?fields=name,DE:Role name

Output will be slightly more digestible 

 

Good luck