link between a project and a user

Yves DIGUET September 2, 2012

Hello

I would like to switch requested sql to find a link between a project and a user because I want to make space for new users and for now I can not find anything.

thank you for your help

SELECT * FROM `jira5.5.1`.cwd_user;

SELECT * FROM `jira5.5.1`.cwd_group;

SELECT * FROM `jira5.5.1`.cwd_membership;

SELECT * FROM `jira5.5.1`.Project;

Select x.Id,

x.parent_id,

x.child_id,

x.Group_Type,

x.Parent_Name,

x.child_name,

y.display_name,

y.email_address,

z.group_name

From `jira5.5.1`.cwd_membership x, `jira5.5.1`.cwd_user y, `jira5.5.1`.cwd_group z

Where x.child_id = y.ID

and Not(y.email_address like '%******')

and x.parent_id = z.id

Order By x.Child_id,

x.Parent_id;

Select x.Id,

x.parent_id,

x.child_id,

x.Group_Type,

x.Parent_Name,

x.child_name,

y.display_name,

y.email_address,

z.group_name

From `jira5.5.1`.cwd_membership x, `jira5.5.1`.cwd_user y, `jira5.5.1`.cwd_group z

Where x.child_id = y.ID

and Not(y.email_address like '%*****')

and x.parent_id = z.id

Order By x.Parent_id,

x.Child_id;

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 2, 2012

Well, the standard warning springs to mind - do NOT try to do this with SQL. It is not safe to manipulate a Jira database without a good solid proven backup, AND Jira completely shut down.

That said, you need to put a bit more thought into this. Users don't have to be directly associated with a project, and you need to think through what you mean by "link between project and user". Do you consider the right to "browse" a project that "link"? If so, you need to read the permission scheme which may define users by group, role, dynamic role (Assignee, reporter, custom field), or even individuals. Users could be directly in roles associated with projects, or your whole user system might be group based.

I think you need to think about what a user/project link is, and tell us what you're trying to do without deciding the method (it may be easier to script or code than using SQL) and then get back to us.

Suggest an answer

Log in or Sign up to answer