Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Database Query: List of watchers

Mike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2018

Is it possible to query a list of all issues and the watchers of each issue within a project?

 

2 answers

1 accepted

4 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2018

Hello,

It would be like this:

SELECT *
  FROM jiraissue i, userassociation a, project p 
WHERE ASSOCIATION_TYPE = 'WatchIssue'
and
i.ID = a.SINK_NODE_ID
and i.project = p.id
and p.pley = 'youkey'
Mike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2018

I am getting: 

Msg 207, Level 16, State 1, Line 6

Invalid column name 'pley'.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2018
SELECT *
  FROM jiraissue i, userassociation a, project p 
WHERE ASSOCIATION_TYPE = 'WatchIssue'
and
i.ID = a.SINK_NODE_ID
and i.project = p.id
and p.pkey = 'youkey'
Like # people like this
2 votes
Gregory Kneller
Contributor
August 24, 2021
SELECT u.lower_username, concat(p.pkey,'-',issuenum) 
FROM jiraissue i, userassociation a, app_user u, project p 
where association_type='WatchIssue' 
     and i.id=sink_node_id 
     and i.project=p.id
     and  a.source_name=u.user_key
Elizabeth Ramsey June 20, 2023

This query was perfect for what I need... you just need to change u.lower_username to u.lower_user_name.  Thanks! =)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events