我尝试过查看JIRA网站和JQL文档。我们有一个我们正在使用的看板,理想情况下,我希望在以任何其他方式排序之前显示每个用户在列中存在问题的最高优先级问题。
现在,我已按优先级DESC订购,它将显示以下内容:
- UserA P1
- UserA P2
- UserB P2
- UserB P3
- UserC P3
- UserC P3
- UserA P4
- UserB P4
理想情况下,我希望看到的是(使用相同的数据):
- UserA P1
- UserB P2
- UserC P3
- Rest of tickets ordered by priority
可以在JQL中做到吗?
答案 0 :(得分:2)
我不认为您可以选择在JQL中执行此操作,但您可以直接访问jira数据库。
您可以在此处获取有关数据库架构的更多信息
例如,这是jiraissue
表
mysql> desc jiraissue;
+----------------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+---------+-------+
| ID | decimal(18,0) | NO | PRI | NULL | |
| pkey | varchar(255) | YES | UNI | NULL | |
| PROJECT | decimal(18,0) | YES | MUL | NULL | |
| REPORTER | varchar(255) | YES | | NULL | |
| ASSIGNEE | varchar(255) | YES | MUL | NULL | |
| issuetype | varchar(255) | YES | | NULL | |
| SUMMARY | varchar(255) | YES | | NULL | |
| DESCRIPTION | longtext | YES | | NULL | |
| ENVIRONMENT | longtext | YES | | NULL | |
| PRIORITY | varchar(255) | YES | | NULL | |
| RESOLUTION | varchar(255) | YES | | NULL | |
| issuestatus | varchar(255) | YES | | NULL | |
| CREATED | datetime | YES | | NULL | |
| UPDATED | datetime | YES | | NULL | |
| DUEDATE | datetime | YES | | NULL | |
| RESOLUTIONDATE | datetime | YES | | NULL | |
| VOTES | decimal(18,0) | YES | | NULL | |
| WATCHES | decimal(18,0) | YES | | NULL | |
| TIMEORIGINALESTIMATE | decimal(18,0) | YES | | NULL | |
| TIMEESTIMATE | decimal(18,0) | YES | | NULL | |
| TIMESPENT | decimal(18,0) | YES | | NULL | |
| WORKFLOW_ID | decimal(18,0) | YES | MUL | NULL | |
| SECURITY | decimal(18,0) | YES | | NULL | |
| FIXFOR | decimal(18,0) | YES | | NULL | |
| COMPONENT | decimal(18,0) | YES | | NULL | |
+----------------------+---------------+------+-----+---------+-------+
要获得排名,您可以在MySQL中使用以下查询
SELECT ASSIGNEE,
PRIORITY,
MAX(rank)
FROM (SELECT ASSIGNEE,
PRIORITY,
CASE
WHEN @prevRank = SUBSTR(PRIORITY, 2) THEN @curRank
WHEN @prevRank := SUBSTR(PRIORITY, 2) THEN @curRank := @curRank + 1
END AS rank
FROM jiraissue,
(SELECT @curRank :=0, @prevRank := NULL) r
ORDER BY PRIORITY) t
GROUP BY ASSIGNEE
请参阅此SQLFiddle
答案 1 :(得分:0)
访问Jira的数据库并不好。如果您正在寻找特定用户的查询显示任务,您可以这样做:
project = name_of_project和assignee = name_of_user