Working with Issue Tracking in NetBeans IDE

In NetBeans IDE you can work with issue trackers and perform common tasks such as searching and updating issues and reporting new issues. If your project is under version control, you can update issues as part of the commit process. In this tutorial you will use the IDE to open a sample project from a version-controlled repository. After you open the project, you will see how to view the project issues, report a new issue, apply a patch file attached to an issue and resolve an issue when you commit the changes. This tutorial will also demonstrate how to register and use an external issue tracker in the IDE.

Watch the Video of Using Integrated Issue Tracking in NetBeans IDE.

Contents

Content on this page applies to NetBeans IDE 7.0, 7.1, 7.2 and 7.3

To follow this tutorial, you need the following software and resources.

Software or Resource Version Required
NetBeans IDE 7.0, 7.1, 7.2, 7.3
Java Development Kit (JDK) version 6 or 7
Anagram Game sample project  

Note.This tutorial requires the Subversion version control system. For more details about using Subversion in the IDE, see the section on setting up Subversion in the Guided Tour of Subversion.

Opening the Sample Project

For the purpose of demonstration, this tutorial uses the sample project Anagram Game to demonstrate how to work with an issue tracker in the IDE. The sources for the Anagram Game sample project exists as a NetBeans project in a Subversion repository and there is a Bugzilla issue tracker for the project. The tasks demonstrated in this tutorial can be used with any supported issue tracker (Bugzilla, JIRA) and version control system (Subversion, Mercurial).

If you know the location of the project repository, you can use the Checkout wizard to check out the sources directly from the repository. Perform the following steps to check out the project sources directly using the Checkout wizard.

  1. Choose Team > Subversion > Checkout to open the Checkout wizard.
  2. Type https://svn.kenai.com/svn/anagram-game~subversion for the Repository URL. Click Next.
  3. In the wizard, click Browse to specify the repository folder and select AnagramGame. Click OK.
  4. Specify the location of the Local Folder for the local repository.
  5. Click Finish.

    When you click Finish, the IDE initializes the local folder as a Subversion repository and checks out the project sources.

  6. Click Open Project in the dialog that appears when checkout is complete.

After you click Open Project, the project is opened as a NetBeans project in the Projects window.

Note. This tutorial demonstrates how to work with stack traces and apply a patch that is attached to an issue. To perform these tasks you will need to check out the project sources.

Registering an Issue Tracker

The IDE enables you to register any number of supported issue trackers. After you register the tracker, the tracker name is added to the Issue Tracker dropdown list in issue forms and commit dialog boxes, enabling you to view, update and create issues from within the IDE. You can register an existing Bugzilla or JIRA issue tracker with the IDE in the Services window.

Note. To use a JIRA issue tracker, you must download the JIRA support plugin from the Update Center. For more information, see the NetBeans FAQ How do I get and install the NetBeans JIRA plugin?

Perform the following steps to register the issue tracker for the Anagram Game project.

  1. Right-click the Issue Trackers node in the Services window and choose Create Issue Tracker.
  2. Select the Connector for the issue tracker.
    (Anagram Game uses a Bugzilla tracker.)
  3. Type AnagramGame for the issue tracker.

    The name is used to identify the issue tracker in IDE windows and dialog boxes.

  4. Specify the URL for the issue tracker.
    (The URL for the issue tracker for Anagram Game is http://kenai.com/bugzilla/)
  5. Click Validate to test the connection to the issue tracker. Click OK.
Screenshot of Create Issue Tracker dialog

When you click OK, the IDE adds a node for the new issue tracker under the Issue Trackers node in the Services window.

Screenshot of Services window that shows registered issue tracker

After you add the issue tracker, you can right-click the tracker's node to perform the following tasks.

  • Find existing issues
  • Report a new issue
  • Edit the details of the issue tracker
  • Remove the issue tracker from the list

You can also find and report issues by choosing the task from the Team menu.

Finding and Viewing Issues

In this section you will use the Find Issues window in the IDE to retrieve a list of the open issues for the Anagram Game project. The issue tracker associated with the Anagram Game project contains some examples of issues. You can open the Find Issues window by selecting the task from the Team menu.

Searching for Issues and Saving Search Queries

In this exercise you will use the Find Issues form to search for all new P1 issues.

  1. Choose Team > Find Issues from the main menu to open the Find Issues window.

    Alternatively, you can right-click the node for the issue tracker in the Services window and choose Find Issues.

  2. Select Anagram Game from the Issue Tracker dropdown list.
  3. Select anagram-game from Product list.
  4. Specify additional search criteria by selecting New as the Status and P1 as the Priority. Click Search.
    Screenshot of Find Issues form

    When you click Search, the IDE searches for all issues that match the criteria and displays a list of the results at the bottom of the form.

    Screenshot of search results in Find Issues form
  5. Click Save this query at the bottom of the Find Issues tab.
  6. Type New P1 issues as the name for the query in the Save Query dialog box. Click Save.

    When you click Save, the IDE opens the Query tab that displays the query results.

    Screenshot of Query window that shows saved query results

After you save the query, you can run the query again at any time from the Find Issues tab by clicking the name of the displayed next to My Queries. You can double-click an issue in the list to open the issue in a new tab.

In the Query tab, you can do the following to modify the list of issues.

  • Click a column heading to sort the order in which the issues are listed
  • Filter the displayed results by using the Filter dropdown list
  • Retrieve the most recent list of issues by clicking Refresh

Click Modify Query in the Query tab to modify the search criteria of the saved query.

Viewing and Updating an Issue

In this exercise you will view and then modify the details of one of the issues of Anagram Game project.

You can view and update an issue within the IDE by double-clicking the issue in the search results list. You do not need to be a member of a project or logged in to view an issue, but if you want to update the issue to resolve the issue, add comments, change the priority, etc., you must be registered with the issue tracker for the project and you must be logged in.

When you are added as a member to a Kenai project you are automatically registered with the project's issue tracker and can modify issues and submit new issues.

  1. Open the list of project issues.
  2. Double-click Issue #257 Typo in StaticWordLibrary to view the issue details in the main window.
  3. Make any changes to the issue details and add a comment. Click Submit Changes.

When you click Submit Changes, the IDE connects with the issue tracker to update the issue details. An email is sent to the person making the changes to the issue, the assignee and to any other addresses copied in the issue.

Note. In this tutorial you will not be able to submit the changes to this issue because you are not a member of the Anagram Game project.

Screenshot of issue open in Issues window

Reporting a New Issue

This section demonstrates how to submit a new issue for the Anagram Game project from within the IDE.

You can use the Report a New Issue form in the IDE to submit a new issue to a registered issue tracker. You can open the form by choosing Team > Report an Issue from the main menu and then choosing the issue tracker from the dropdown list in the form.

Note. To report an issue you must be registered with the issue tracker and you must be logged in. If you are not logged in you will be prompted to log in when you submit the issue.

To report a new issue for the Anagram Game project, perform the following steps.

  1. Choose Team > Report Issue from the main menu to open the Report a New Issue window.
  2. Select the tracker from the Issue Tracker dropdown list.
  3. Select the project from the Product dropdown list.
  4. Specify the issue details, summary and description. Click Submit Issue.

When you click Submit Issue, the IDE submits the issue to the tracker.

Note. In this example you will not be able to submit the issue because you are not a member of the project.

Working with Stack Traces

When an issue description contains a stack trace that refers to a project's source code, you can navigate directly from the issue to the line in the local source code. The stack trace that is copied to the issue can be used the same way as a stack trace in the Output window.

Note. To navigate to lines in the source code from a stack trace, the project sources must be checked out and the project must be open in the IDE.

  1. Open Issue 1446 Cannot start AnagramGame due to NullPointerException.

    Issue 1446 of the Anagram Game project states that a NullPointerException is thrown when you run the application.

  2. In the issue description, click on the following line in the stack trace.
    com.toy.anagrams.ui.Anagrams$2.windowOpened(Anagrams.java:72)

    The issue description contains a copy of the stack trace that was copied from the Output window.

    Screenshot of issue showing stack trace

When you click on the line in the stack trace, the IDE opens the local file in the editor and places the insert cursor in the indicated line in the source code.

Note. The IDE can open the local file because you checked out the sources earlier in this tutorial.

You can reproduce the exception by launching the Anagram Game application and then viewing the output in the Output window. In the Output window you should see output similar to the following.

Screenshot of Output window that shows stack trace

Opening and Applying a Patch File

In this section you will view an attached patch file and then apply the patch.

Issue 1446 reports that a NullPointerException occurs when you run the Anagram Game application. A patch file is attached to the issue that contains a fix for the NullPointerException. When a patch file is attached to an issue, you can open and apply the patch directly from the issue window.

  1. Open Issue 1446 Cannot start AnagramGame due to NullPointerException.
  2. Click the name of the patch file that is attached to the issue.
    Screenshot of issue window showing attached patch

    When you click the file name, the IDE opens the file in the editor. You can see that the patch makes the following change to StaticWordLibrary.java.

    -    static WordLibrary DEFAULT;
    +    final static WordLibrary DEFAULT = new StaticWordLibrary();

    Close the patch file.

  3. In the window for the issue, click apply next to the name of the attached patch file to open the Apply Patch dialog box.
  4. Expand the Anagram Game project and select the Source Packages directory in the Apply Patch dialog. Click Apply.
    Screenshot of Apply Patch dialog

    Note. When applying a patch, you need to select the directory or file according to the root location when the patch was created. In this case, you need to specify the Source Packages directory as the root location when applying the patch.

When you click Apply, the IDE applies the patch and modifies StaticWordLibrary.java. You can open the file in the editor to view the changes. If you look in the Projects window, you can see that the IDE marks the file as modified.

Integration with Version Control

In this section you update an issue as part of the process of committing a change to the sources of the Anagram Game project.

The IDE integrates support for source code version control (using Subversion or Mercurial) and supported issue trackers. The integrated support enables you to update issues on a registered issue tracker as part of the commit process.

Kenai offers dedicated version control repositories as one of the services available to hosted projects. When you opened the Kenai project Anagram Game and checked out the project sources, the IDE automatically associated the project with the project's issue tracker.

For details on using Subversion in NetBeans IDE, see the Guided Tour of Subversion.

For more about Kenai support for version control systems, see the Kenai documentation on Source Code Management.

This exercise demonstrates how to update an issue as part of the commit process.

  1. Expand the com.toy.anagrams.lib package under the Source Packages node in the Projects window.
    Screenshot of Projects window that shows project under version control

    The Anagram Game is already in a version control repository. The names of modified source files that need to be committed to the repository are blue. The badge on the directories indicates that they contain files that need to be committed.

  2. Right-click the StaticWordLibrary.java file and choose Subversion > Commit to open the Commit dialog.
  3. Enter a Commit Message that describes the commit.
  4. Expand the Update Issue panel in the Commit dialog.
    Screenshot of Commit dialog
  5. Select the issue tracker for the Anagram Game project from the dropdown list (if not selected).
  6. Type 1446 in the Issue field.

    The changes to StaticWordLibrary.java that you are committing will fix the exception reported in Issue 1446.

    You can type the issue id (1446) or some text contained in the issue description (NullPointerException) in the Issue field. The IDE will display a list of issues that match the text.

  7. Select the Resolve as FIXED checkbox.

    Selecting Resolve as FIXED will change the status of the issue to Resolved.

  8. (Optional) Select Add details to commit message and issue to add additional details. You can click modify to open a dialog that enables you to modify how the additional details are formatted.
  9. Click Commit.

When you click Commit, the IDE commits the changes to the repository and updates the issue. You will be prompted to supply a username and password if you are not logged in.

Note. In this example you will not be able to commit the changes because you are not a member of the project.

This tutorial described how you can use the IDE to work with issue trackers. The integrated support for the Bugzilla and JIRA issue trackers enables you to view, update and report issues from within the IDE. For projects hosted on a Team Server and associated with an issue tracker that is also hosted on a Team Server, you can install the Team Server plugin from the Update Center and work with project issues from the Team dashboard.

For other projects, you can register a Bugzilla or JIRA issue tracker with the IDE and then use the Team menu items to view and report issues.


See Also

For additional information on using NetBeans IDE in a collaborative environment, see the following tutorials.

get support for the NetBeans

Support


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo