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.
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.
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.
When you click Finish, the IDE initializes the local folder as a Subversion repository and checks out the project sources.
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.
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.
The name is used to identify the issue tracker in IDE windows and dialog boxes.
When you click OK, the IDE adds a node for the new issue tracker under the Issue Trackers node in the Services window.
After you add the issue tracker, you can right-click the tracker's node to perform the following tasks.
You can also find and report issues by choosing the task from the Team menu.
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.
In this exercise you will use the Find Issues form to search for all new P1 issues.
Alternatively, you can right-click the node for the issue tracker in the Services window and choose Find Issues.
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.
When you click Save, the IDE opens the Query tab that displays the 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 Modify Query in the Query tab to modify the search criteria of the saved query.
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.
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.
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.
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.
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.
Issue 1446 of the Anagram Game project states that a NullPointerException is thrown when you run the application.
The issue description contains a copy of the stack trace that was copied from the Output window.
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.
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.
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.
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.
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.
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.
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.
Selecting Resolve as FIXED will change the status of the issue to Resolved.
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.
For additional information on using NetBeans IDE in a collaborative environment, see the following tutorials.