Post

2 followers Follow
0
Avatar

Issues when fetching participants Resources of a Project (via CZQL, REST API)

I try to retrieve users participating in a project using this command (as Ophir suggested in this post):
SELECT name, (SELECT name, email FROM resources) FROM project
and it seems to work fine, but I have 2 issues:

  1. It brings more people than the members of the project (for example, a Sales VP or accountant)
  2. I try to fetch the participant's role - the 'JobTitle' field (?) in the same way, for filtering:
    SELECT name, (SELECT name, jobtitle, email FROM resources) FROM project
    But it returns 'null' for the jobtitle field. Am I doing it in incorrect way? Or it means I have no permission to get the JobTitle field?

Thanks in advance.

S/S Answered

Please sign in to leave a comment.

9 comments

0
Avatar

Hi S.

  1. The Resources collection returns the content of what you see in the Resources panel/field of the project. The Sales VP or accountant you mentioned are probably resources of the project in that sense. What do you expect 'the members of the project' to be?
  2. The JobTitle field (like other fields in the inner Select) is a field of User (their Job title as it appears in the People module). If you have a null value there it probably means a Job Title was not set for those users (or for some reason your API user has no permission to see it). Where does the 'role' information you expected appear?

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Hi Ophir,
My aim is to get the list of developers-team currently working on the project, e.g. developers, testers, project manager and project coordinator; so I am trying to:

  1. Directly get the list of these team members. Is it possible?
  2. Get the list of all members and filter them by using JobTitle.
    To make sure I have (no) permission, I tried to get the non-null JobTitles directly from users:
    SELECT name, jobtitle FROM user WHERE jobtitle<>null
    and it still returns all users but jobtitle is still 'null' (even when I have the "WHERE jobtitle<>null" condition).
    So probably it means I have no permission to get JobTitle, is it right?
  3. Is there any other field which I can check? or a better way to achieve the goal?

Thanks

S/S 0 votes
Comment actions Permalink
0
Avatar

The problem is solved.
It turned out I had no permission to see the "Job Title" field, and that's why I was getting nulls.
Also 'odd' members were really in project resources, and their job title was "Non Project Stuff".
So I changed jobtitle to jobtitle.name and filtered odd fields, here is the final query:
SELECT name, (SELECT name, jobtitle.name, email FROM resources WHERE jobtitle.name<>"Non Project Stuff") FROM project

Though it's strange - all project members are visible but their job titles are not accessible (for accounts which have 'default' permissions); usually job title is not something to hide, maybe it's a bug?

Anyway, thank you Ophir for helping

S/S 0 votes
Comment actions Permalink
0
Avatar

Hi S.,

Why didn't you have permissions to Job Titles? (how did you restore it?)

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Tried it with account which has high privileges, and it worked fine.
But I have no access to the Job Title field with my own account. I asked administrators about my account type/permissions, and they told me it's a default account with default permissions (though I don't know what they mean by saying "default").
So, maybe such "default" accounts have no access to job title? Could you (or anyone else) run this query on a default account to check it?
SELECT jobtitle.name FROM user
Maybe it's a bug in Clarizen? Or because of incorrect permissions set by our admins?

S/S 0 votes
Comment actions Permalink
0
Avatar

Hi S.

Regular full license user should have access to Job titles.

Perhaps you were invited as an External user which has limited permissions to view other users (except for their name). You should be able to view the 'External User' mark on your user details page in Clarizen.

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

I've just checked Clarizen's "My Details" page and there is no word about "External User".
Also I don't see my job title there (should it be there?).
And strangely querying my own jobtitle using:
SELECT name, jobtitle.name FROM user WHERE name='MyNameHere'
returns null for jobtitle too, though it's correct when accessing from a higher-level account.

I start thinking that it's because of incorrect permissions.
(What it returns if you run from within your account, or a default account?)

S/S 0 votes
Comment actions Permalink
0
Avatar

Hi S.

If you can't find the External User setting on your user details you can search for it in the search box (see screenshot)

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Hi Ophir,
Tried in all possible search-boxes in all pages - no result for word "External"

S/S 0 votes
Comment actions Permalink