Post

2 followers Follow
0
Avatar

CZQL Query

Hi , Help Me Out

I need a Query with having custom columns

Work Item    Custom Column
Project       : - Instancy Group ID   API name:C_OrgUnitID

Task           : - Instancy Track ID     API name:C_TrackID


i need a query like to get the task id inside the project based on Instancy Group ID with match with Instancy Track ID and resourse.

 

 

My Work Out is like this 


"select name from task where project in (select id from project where C_OrgUnitID='" + GroupID + "') and id in (SELECT ID FROM task WHERE C_TrackID= '" + trackid + "')";


"SELECT WorkItem.Name,Resource.Name FROM RegularResourceLink WHERE Resource IN (SELECT id FROM User WHERE email in ('" + UserEmailID + "')) and WorkItem IN (SELECT ID FROM task WHERE C_TrackID= '" + trackid + "')";

but i Need with relation with C_OrgUnitID (i.e Instancy Group ID),C_TrackID (i.e Instancy Track ID) and EMAIL to get task id

 

Thanks

surya Answered

Please sign in to leave a comment.

2 comments

0
Avatar

My Work Out is like this 

 


"select name from task where project in (select id from project where C_OrgUnitID='" + GroupID + "') and id in (SELECT ID FROM task WHERE C_TrackID= '" + trackid + "')";


"SELECT WorkItem.Name,Resource.Name FROM RegularResourceLink WHERE Resource IN (SELECT id FROM User WHERE email in ('" + UserEmailID + "')) and WorkItem IN (SELECT ID FROM task WHERE C_TrackID= '" + trackid + "')";

 

but i Need with relation with C_OrgUnitID (i.e Instancy Group ID),C_TrackID (i.e Instancy Track ID) and EMAIL to get task id

 

Thanks

surya 0 votes
Comment actions Permalink
1
Avatar
"select name from task where project in (select id from project where C_OrgUnitID='" + GroupID + "') and id in (SELECT ID FROM task WHERE C_TrackID= '" + trackid + "')";

Should be modified by

"select name from task where project in (select id from project where C_OrgUnitID='" + GroupID + "') and C_TrackID= '" + trackid + "'";

if you want to get the tasks with C_TrackID under project with C_OrgUnitID. Note that there's a difference between Project and ParentProject, ParentProject is the Project directly above the considered task. Project can be something else (maybe the top level Project, but I'm not sure).

On your second query, it seems you want to filter requested users on there email as well. So that would result in checking if a specific user (given by email) is a resource of tasks with your criteria. Either you get results, and the user is a resource, or you get nothing.

 

Armand BOLMONT 1 vote
Comment actions Permalink