Clone wiki

jira-watcher-field-plugin / Home

!!! WARNING !!!

TL;DR: Users of plugin version 2.6.1 through 2.6.3 should upgrade to version 2.6.5.

Plugin versions 2.6.1 to 2.6.3 are incompatible with the "autowatch" feature in JIRA 7+. If you are unable to update to a newer version, disable the "autowatch" feature in JIRA 7+. A user with "autowatch" enabled can cause users to be unable to be removed as watchers. This issue was fixed in version 2.6.5.

Welcome

Welcome to the JIRA Watcher Field Plugin Wiki. This plugin adds a custom field type that allows watchers to be modified on issue creation/modification.

Installation

  1. Install the plugin via the Atlassian Marketplace
  2. Add a new custom field of type "Watcher Field", fill out the custom field details, and add it to some screens.

For more detailed instruction, follow the Atlassian guide for adding a custom field.

Upgrading JIRA

Note: It is recommended to test upgrading in a testing/staging environment first before upgrading production installations.

Here are the steps I recommend when upgrading JIRA:

  1. Check add-on compatibility with application updates guide to check for compatibility. If you find that the plugin is not compatible and upgrading fails, try disabling the plugin for the upgrade. See issue 32 for more info.

  2. I recommend, with any kinda of mission critical JIRA installation, to follow the instructions in the Upgrading JIRA with a Fallback Method guide. Otherwise, I would follow the directions in the Upgrading JIRA guide that best apply to your install.

  3. Update and re-enable the plugin, if needed.

Usage

This field acts the same as any old "Multi User Picker" field, except it contains a list of all the watchers on an issue. When creating an issue, it will be blank. When modifying an issue, it will be populated with the watchers of that issue, if they exist. Removing names from the field will also remove them as watchers on update. Only users that have the "Manage Watcher List" permission have access to this field. If a user does not have permissions, they will only see the message "You do not have permission to manage the watcher list." with a list of the current watchers.

Configuration

The watcher field plugin as a few configuration options available. To access...

  1. Click on the cog in the top right corner ("Administration").
  2. Click on the "Add-ons" tab.
  3. Under the "WATCHER FIELD" section on the left, click on "Watcher Field Settings".

You will find the following settings:

  • Allow JIRA to add watchers independently.
    • Useful for adding watchers to issues without using a logged in user. I.e., email processing.
  • Allow users to be added as watchers regardless of Browse Issue permissions
    • This settings allows users to be added as watcher regardless of their permission.
  • Allow deactivated users to be added/ignored as watchers.
    • This setting allows inactive users to be added to new issues or ignored if editing an existing issue

Version History

Below you'll find information on specific versions of the plugin. Please read before upgrading between revisions. Some major changes have been made between revisions.

1.0

Initial Release

1.0.1

Enabled ability to set default value.

1.0.2

Fixed issue where custom field would always cause an update even if field was not updated.

1.2.0

Add Features:

Bug Fixes:

1.3.0

Made compatible with JIRA 3.13.3-3.13.5

1.4.0

Be Careful This is for existing users of the JIRA Watcher Field Plugin. If you are a new user and are using JIRA 4.0, please use version 2.0 of the plugin.

Made compatible with JIRA 4.0

2.0

Be Careful This is for new users of the JIRA Watcher Field Plugin. If you are an existing user and are using JIRA 4.0, please use version 1.4.0 of the plugin.

Made compatible with JIRA 4.0

1.4.1

Be Careful If you are a new user or upgrading from version 2.0, use version 2.1. Made compatible with JIRA 4.1 Added REST call to query watchers of an issue. Dynamically updates an issue when modifying the watcher list.

2.1

Be Careful If you are a upgrading from version 1.4.0, use version 1.4.1. Made compatible with JIRA 4.1 Added REST call to query watchers of an issue. Dynamically updates an issue when modifying the watcher list.

2.3

  • Made compatible with JIRA 4.2
  • Fixed a minor javascript error with the rest call after clicking on the quick watch/unwatch link.

Please read if using version 1.x of the plugin

I can't seem to be able to create a 1.x version of the plugin (for users of the plugin from back in 3.13.x) because it seems that Atlassian does not allow for 3rd party plugins to share the same namespace as theirs in version 4.2. I suppose it was inevitable at some point.

So, if you need to upgrade and you are using a version 1.x then you have a few options that I can think of: Note: BACKUP YOUR DATA FIRST and remember to ALWAYS test upgrading in a sandbox (or test) environment first.

Recreate the watcher field

This will require you to have to recreate the watcher field and everywhere it is used. There should be no reason for this to mess up any of your watcher settings. 1. Remove the old watcher field 1. Delete the old plugin 1. Install the new one.

Change the namespace in an XML backup.

This could require a lot of downtime depending on the size of your installation. Remember it's always best to modify a copy...not the original.

  1. Turn off the ability for users to login (remove jira-users from the global permissions section, I think). This makes sure that your XML backup is up to date.
  2. Make an XML backup of JIRA
  3. Using your favorite text editor, replace all references of "com.atlassian.jira.issue.customfields.impl.jira-watcher-field:watcherfieldtype" with "com.burningcode.jira.issue.customfields.impl.jira-watcher-field:watcherfieldtype".
  4. Re-import the XML backup.
  5. Turn on ability for users to login

Sorry everyone. I understand that this is frustrating, but, my hands are tied. Feel free to download the source yourself and see if you can get it working with the old namespace.

Change the namespace in the database (dangerous!)

This "should" change the namespace everywhere so you can use your existing watcher field. That being said...I can't promise anything. If you play around in the database and break something then I'm not responsible. Do yourself a favor and test this first in a test environment. Please.

A great way to find out what records you'll have to change is to find all references in an XML backup for "com.atlassian.jira.issue.customfields.impl.jira-watcher-field:watcherfieldtype". The XML node for the record is usually a good indication of the table where the change needs to be made and the node should have an "id" attribute of the record in the table.

  1. Shutdown JIRA
  2. Find the "CustomField" table in the database and change all references to "com.atlassian.jira.issue.customfields.impl.jira-watcher-field:watcherfieldtype" to "com.burningcode.jira.issue.customfields.impl.jira-watcher-field:watcherfieldtype". If you find any other references, you should change those too.
  3. Install new version of the plugin and start JIRA.
  4. Cross fingers.

2.4

  • Updated plugin to support JIRA 4.3
  • See version 2.3 for information on upgrading from using version 1.x of the plugin.

2.4.1

Resolves JWFP-19; https://studio.plugins.atlassian.com/browse/JWFP-19.

2.5.1

2.5.3

2.5.5

A big difference in this release is the field checks that watchers have the ability to browse the issue/project before being added. This is the way JIRA does it and the field was being used as a workaround for this (JWFP-22).

This release is also a bit different in that the watcher field is no longer displayed when viewing an issue (or screen). The reason for this is JIRA already provides a good way to view watchers. Also, trying to get the watcher field to be wired up when toggling watchers or inline editing was causing headaches with little benefit.

The RESTful interface is still there, in case someone out there was using it. JWFP-22: Field verifies that watchers can view the issue/project before adding Removed the field from being displayed when viewing the issue. Was causing too many issue making work with the watcher toggle. Besides, JIRA already provides a good way to view the watchers from the issue. Removed the javascript included. No longer needed without the field viewable from the issue. Field is still viewable from issue navigator JWFP-29: Now works in JIRA 5.1

2.5.7

  • Issue #4, #5: Added setting for enabling adding users as watchers that do not have browse issue permissions. Off by default.
  • Re-added the watcher field to be included in the issue screen.

2.5.9

  • Improved and fixed bugs in the watcher validation

2.5.10

  • Add compatibility for JIRA 6

2.5.11

  • Fix the Watcher Field Settings link not being displayed.

2.5.13

  • Updated to support JIRA 6.2.
  • Added "#disable_html_escaping()" to the velocity templates.

Download Source

Run the following command from the command line to download a copy of the source.

git clone https://bitbucket.org/rbarham/jira-watcher-field-plugin.git

Updated