Extracting whole User Names and Roles via API in Workfront | Community
Skip to main content
Level 2
October 4, 2023
Question

Extracting whole User Names and Roles via API in Workfront

  • October 4, 2023
  • 3 replies
  • 1140 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

lgaertner
Level 9
October 4, 2023

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.

undu82
Level 2
October 4, 2023

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

Rafal_Bainie
Community Advisor
Community Advisor
October 25, 2023

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:

 

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