Hello!
How to find issues's watchers Id's in the jira schema(https://developer.atlassian.com/server/jira/platform/attachments/jira-7-9-2-database-schema.pdf)?
What table contains this information?
Thanks.
Please, move away from using SQL to read the database. It's slow, complex, bypases all the security, is hard to understand, and can cause performance issues. Most of the reporting I see based on SQL queries is also horribly horribly inaccurate and wrong.
The data you are looking for is in nodeassociation, but if you look at that, you'll find it's pretty horrible to use, and you really should be using the REST API for automated reporting.
It is just an opinion. I use sql to read and change jira data since 2009. Fast, simple, and bypass security (I do not need it), no problems with performance
And in 3 months time when something fails because you damaged your data? Stop it. It's the wrong thing to do.
SELECT
u.lower_username, <span>u.user_key, </span>
p.pkey,
issuenum
FROM
jiraissue i, userassociation a, app_user u, project p<span> </span>
where
association_type=
'WatchIssue'
and a.source_name=u.user_key
and
i.id=sink_node_id<span> </span>
i.project=p.id
<span> </span>
Nic, there is no REST API for many things. Sometimes database is the only way, of the fast shortcut.Database changes shall be applied with care and responsibility. If you are not sure, check in a test instance first, and create a copy of changed table. And you must know SQL.
But nothing bad in select sql, RDBMS handles it much faster than java classes.
I have being doing it since more than 10 years, never ran into "in 3 months time when something fails because you damaged your data". Actually, the question is not whether one may use database, but how to find watchers there.
It looks like you're new here. Sign in or register to get started.