这是一个jql查询,我得到了
的结果assignee in membersOf("project")
这将返回属于项目的成员的问题。
我想知道在jira数据库的哪个表中存储了这个数据(或者哪个成员属于哪个proj的链接)?
答案 0 :(得分:3)
组成员身份存储在CWD_MEMBERSHIP
表中。
示例:
SELECT LOWER_CHILD_NAME
FROM CWD_MEMBERSHIP
WHERE MEMBERSHIP_TYPE = 'GROUP_USER'
AND LOWER_PARENT_NAME = 'jira-administrators';
示例2,也是为了获取用户信息:
SELECT
U.*
FROM
CWD_MEMBERSHIP M
INNER JOIN CWD_USER U
ON
M.LOWER_CHILD_NAME = U.LOWER_USER_NAME
WHERE
M.MEMBERSHIP_TYPE = 'GROUP_USER' AND
M.LOWER_PARENT_NAME = 'jira-administrators';
但项目角色成员资格位于PROJECTROLE
和PROJECTROLEACTOR
表中。
示例:
SELECT A.ROLETYPEPARAMETER AS USERNAME, R.NAME AS ROLENAME, P.PKEY || ' - ' || P.PNAME AS PROJECTNAME
FROM PROJECTROLEACTOR A
INNER JOIN PROJECTROLE R ON A.PROJECTROLEID = R.ID
INNER JOIN PROJECT P ON A.PID = P.ID
WHERE P.PKEY = 'YOUR_PKEY_COMES_HERE'
ORDER BY 3, 1, 2;
示例2,获取明确分配给项目角色的用户(而不是通过组):
SELECT A.ROLETYPEPARAMETER AS USERNAME, R.NAME AS ROLENAME, P.PKEY || ' - ' || P.PNAME AS PROJECTNAME
FROM PROJECTROLEACTOR A
INNER JOIN PROJECTROLE R ON A.PROJECTROLEID = R.ID
INNER JOIN PROJECT P ON A.PID = P.ID
INNER JOIN CWD_USER U ON LOWER(A.ROLETYPEPARAMETER) = U.LOWER_USER_NAME
ORDER BY 3, 1, 2;
要获取问题历史记录,您需要加入changegroup
的{{1}}和changeitem
表格。更改组存储更改时间,更改组包含旧数据和新数据,以及更改的字段。
列出前受让人的示例:
jiraissue
最后一行(最新SELECT
CG.AUTHOR AS CHANGE_USER ,
CG.CREATED AS CHANGE_WHEN ,
CI.FIELD AS CHANGED_WHAT,
CI.OLDVALUE AS CHANGED_FROM,
CI.NEWVALUE AS CHANGED_TO
FROM
JIRAISSUE JI
INNER JOIN CHANGEGROUP CG
ON
JI.ID = CG.ISSUEID
INNER JOIN CHANGEITEM CI
ON
CG.ID = CI.GROUPID
WHERE
JI.PROJECT = 10100 AND
JI.ISSUENUM = 1234 AND
CI.FIELDTYPE = 'jira' AND
CI.FIELD = 'assignee'
ORDER BY
CG.CREATED ASC;
)created
必须与newvalue
匹配。jiraissue
- s值。