Unable to Edit Watchers for an Issue

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

When a user tries to edit the Watchers field when viewing an issue, the process never end and thus, the user is unable to edit it. This also manifests with being able to remove the watcher and seeing it successfully remove but upon hitting refresh the watcher is still on the issue.

(Auto-migrated image: description temporarily unavailable)

In the atlassian-jira.log will show the following error message:

1 2 3 4 5 2013-10-31 09:07:37,557 http-80-21 ERROR xxxx 547x111484x1 xxx xx.xx.xxx.xx /secure/QuickEditIssue.jspa [jira.bc.issue.DefaultIssueService] Exception occurred editing issue: java.lang.NullPointerException java.lang.NullPointerException at com.burningcode.jira.issue.customfields.impl.WatcherFieldType.getChangelogValue(WatcherFieldType.java:207) at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getChangelogValue(AbstractMultiCFType.java:43) at com.atlassian.jira.issue.fields.CustomFieldImpl.getChangelogValue(CustomFieldImpl.java:378)

Cause

A user who happens to watch this particular issue has been deleted. This scenario can happen when:

  1. JIRA uses an external user management, for example LDAP.

  2. The user in LDAP watches an issue.

  3. The LDAP admin delete this user from the LDAP.

  4. JIRA then synchronizes with the LDAP server.

This user does not exist in JIRA any-more, but the association of this user with an issue as a watcher still exist.

Workaround

One workaround is to delete these values (the association of this user from watching) directly from the database.

It is always safe to do this modification on a test instance or have an extra XML backup before proceeding with the suggestion.

  1. Shutdown your JIRA instance.

  2. Run the following SQL command on the database to identify the deleted users that are watchers:

    1 SELECT * FROM userassociation WHERE association_type = 'WatchIssue' AND source_name NOT IN (SELECT user_name FROM cwd_user);
  3. The above result should give the username along with the issue ID (note this ID is not the issue key, but rather the ID) and etc.

  4. Remove these users from the database by running the following SQL command on the database:

    1 DELETE FROM userassociation WHERE source_name = '<INSERT-USER-NAME-HERE>';
  5. Start JIRA again and Re-index.

Resolution

  1. Run the following SQL command on the database to update the jiraissue table to the correct number of watchers:

    1 2 3 4 5 6 UPDATE jiraissue i SET watches = (SELECT COUNT(*) FROM userassociation WHERE association_type = 'WatchIssue' AND userassociation.sink_node_id = i.id );
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.