| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- |
| Copyright (c) 2009, 2010, 2011, Oracle and/or its affiliates. All rights reserved. |
| --> |
| <html> |
| <head> |
| <title>Working with Issue Tracking in NetBeans IDE</title> |
| <!-- BEGIN METADATA --> |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8" > |
| <meta name="description" content="Demonstrates how to use work with issue trackers from NetBeans IDE."> |
| <meta name="KEYWORDS" content="NetBeans, issues, issue tracking, bugzilla, jira"> |
| <link rel="stylesheet" href="../../../netbeans.css" type="text/css"> |
| <!-- END METADATA --> |
| |
| </head> |
| <body> |
| |
| <a name="top"></a> |
| <h1>Working with Issue Tracking in NetBeans IDE</h1> |
| |
| <p>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.</p> |
| |
| |
| |
| |
| <p class="tips">Watch the <a href="kenai-issuetracking-screencast.html">Video of Using Integrated Issue Tracking in NetBeans IDE</a>.</p> |
| |
| <p><b>Contents</b></p> |
| <img src="../../../images_www/articles/71/netbeans-stamp-71-72-73.png" class="stamp" alt="Content on this page applies to NetBeans IDE 7.0, 7.1, 7.2 and 7.3" title="Content on this page applies to the NetBeans IDE 7.0, 7.1, 7.2 and 7.3" /> |
| <ul class="toc"> |
| <li><a href="#01">Opening the Sample Project</a></li> |
| <li><a href="#02">Registering an Issue Tracker</a></li> |
| <li><a href="#03">Finding and Viewing Issues</a></li> |
| <li><a href="#04">Reporting a New Issue</a></li> |
| <li><a href="#05">Working with Stack Traces</a></li> |
| <li><a href="#06">Opening and Applying a Patch File</a></li> |
| <li><a href="#07">Integration with Version Control</a></li> |
| </ul> |
| |
| |
| <p><b>To follow this tutorial, you need the following software and resources.</b></p> |
| |
| <table> |
| <tbody> |
| <tr> |
| <th class="tblheader" scope="col">Software or Resource</th> |
| <th class="tblheader" scope="col">Version Required</th> |
| </tr> |
| <tr> |
| <td class="tbltd1"><a href="http://www.netbeans.org/downloads/index.html">NetBeans IDE</a></td> |
| <td class="tbltd1">7.0, 7.1, 7.2, 7.3</td> |
| </tr> |
| <tr> |
| <td class="tbltd1"><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java Development Kit (JDK)</a></td> |
| <td class="tbltd1">version 6 or 7</td> |
| </tr> |
| <tr> |
| <td class="tbltd1"><a href="http://kenai.com/projects/anagram-game">Anagram Game sample project</a></td> |
| <td class="tbltd1"> </td> |
| </tr> |
| </tbody> |
| </table> |
| <!-- |
| <p class="notes"><strong>Notes.</strong></p> |
| <ul> |
| <li>NetBeans IDE supports working with team servers built on the Kenai framework, |
| however, references to Kenai in the IDE were changed |
| to Team to prepare for the move to Java.net.</li> |
| </ul>--> |
| |
| |
| <p class="notes"><strong>Note.</strong>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 |
| <a href="../../docs/ide/subversion.html#settingUp">Guided Tour of Subversion</a>.</p> |
| |
| |
| |
| <!-- ===================================================================================== --> |
| |
| <a name="01"></a> |
| <h2>Opening the Sample Project</h2> |
| <p>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 <a href="http://kenai.com/projects/anagram-game">Anagram Game</a> 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). |
| </p> |
| |
| <p>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.</p> |
| |
| <ol> |
| <li>Choose Team > Subversion > Checkout to open the Checkout wizard.</li> |
| <li>Type <strong>https://svn.kenai.com/svn/anagram-game~subversion</strong> for the Repository URL. |
| Click Next.</li> |
| <li>In the wizard, click Browse to specify the repository folder and select <strong>AnagramGame</strong>. Click OK.</li> |
| <li>Specify the location of the Local Folder for the local repository.</li> |
| <li>Click Finish. |
| <p>When you click Finish, the IDE initializes the local folder as a Subversion repository |
| and checks out the project sources.</p> |
| </li> |
| <li>Click Open Project in the dialog that appears when checkout is complete.</li> |
| </ol> |
| |
| <p>After you click Open Project, the project is opened as a NetBeans project in the Projects window.</p> |
| |
| <p class="notes"><strong>Note.</strong> 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.</p> |
| |
| |
| |
| <!-- ++++++++++++++ Registering an Existing Issue Tracker ++++++++++++++ --> |
| |
| <a name="02"></a> |
| <h2>Registering an Issue Tracker</h2> |
| <p>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.<p> |
| |
| <p class="notes"><strong>Note.</strong> |
| To use a JIRA issue tracker, you must download the JIRA support plugin from the Update Center. |
| For more information, see the NetBeans FAQ |
| <a href="http://wiki.netbeans.org/FaqHowToJira">How do I get and install the NetBeans JIRA plugin?</a></p> |
| |
| <p>Perform the following steps to register the issue tracker for the Anagram Game project.</p> |
| <ol> |
| <li>Right-click the Issue Trackers node in the Services window and choose Create Issue Tracker.</li> |
| <li>Select the Connector for the issue tracker. <br>(Anagram Game uses a Bugzilla tracker.)</li> |
| <li>Type <strong>AnagramGame</strong> for the issue tracker. |
| <p>The name is used to identify the issue tracker in IDE windows and dialog boxes.</p></li> |
| <li>Specify the URL for the issue tracker.<br> |
| (The URL for the issue tracker for Anagram Game is |
| <strong>http://kenai.com/bugzilla/</strong>)</li> |
| <li>Click Validate to test the connection to the issue tracker. Click OK.</li> |
| <!-- <li>Specify the username and password for the issue tracker.</li> |
| <li>(Optional) Select Enable Local Usernames. Click OK. |
| <p class="notes"><strong>Note.</strong> When authorizing and identifying users, some issue trackers are configured to use a registered user name as the user id |
| and some are configured to use an email address. |
| Select this option when the issue tracker is configured to use a user name.--> |
| |
| <!-- When the Enable Local Usernames option is selected, domain names are not included as part of |
| the user names when verifying the user (for example, <tt>joe_user</tt> instead of <tt>joe_user&mydomain.com</tt>. |
| </p> |
| </li> |
| --> |
| </ol> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/create-tracker.png" alt="Screenshot of Create Issue Tracker dialog" title="Create Issue Tracker dialog" class="margin-around b-all"> |
| <p>When you click OK, the IDE adds a node for the new issue tracker under the Issue Trackers node in the Services window.</p> |
| |
| <img src="../../../images_www/articles/73/ide/issue-tracking/services-issue-trackers.png" alt="Screenshot of Services window that shows registered issue tracker" title="Registered issue trackers node in the Services window" class="margin-around b-all"> |
| |
| <p>After you add the issue tracker, you can right-click the tracker's node to perform the following tasks.</p> |
| <ul> |
| <li>Find existing issues</li> |
| <li>Report a new issue</li> |
| <li>Edit the details of the issue tracker</li> |
| <li>Remove the issue tracker from the list</li> |
| </ul> |
| |
| <p class="tips">You can also find and report issues by choosing the task from the Team menu.</p> |
| |
| |
| |
| <!-- <p class="tips">Click <strong>Save this query</strong> to add the search query to your list of saved queries. |
| The query is displayed in the list of My Queries in the Find Issues window when you select the issue tracker.</p>--> |
| |
| |
| |
| |
| |
| <a name="03"></a> |
| <!-- ++++++++++++++ Viewing Open Issues ++++++++++++++ --> |
| <h2>Finding and Viewing Issues</h2> |
| <p>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.</p> |
| |
| <div class="indent"> |
| <h3>Searching for Issues and Saving Search Queries</h3> |
| <p>In this exercise you will use the Find Issues form to search for all new P1 issues.</p> |
| |
| <ol> |
| <li>Choose Team > Find Issues from the main menu to open the Find Issues window. |
| <p>Alternatively, you can right-click the node for the issue tracker in the Services window and choose Find Issues.</p> |
| </li> |
| <li>Select Anagram Game from the Issue Tracker dropdown list.</li> |
| <li>Select <strong>anagram-game</strong> from Product list.</li> |
| <li>Specify additional search criteria by |
| selecting <strong>New</strong> as the Status and <strong>P1</strong> as the Priority. Click Search.<br> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/find-issue-form.png" alt="Screenshot of Find Issues form" title="Screenshot of Find Issues form" class="margin-around b-all"> |
| <p>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.</p> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/find-issue-results.png" alt="Screenshot of search results in Find Issues form" title="Screenshot of search results in Find Issues form" class="margin-around b-all"> |
| </li> |
| <li>Click <strong>Save this query</strong> at the bottom of the Find Issues tab.</li> |
| <li>Type <strong>New P1 issues</strong> as the name for the query in the Save Query dialog box. Click Save. |
| <p>When you click Save, the IDE opens the Query tab that displays the query results.</p> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/find-issue-savedquery.png" alt="Screenshot of Query window that shows saved query results" title="Result of saved query in the Query window" class="margin-around b-all"> |
| |
| |
| </li> |
| |
| </ol> |
| <p>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.</p> |
| |
| |
| <p>In the Query tab, you can do the following to modify the list of issues.</p> |
| <ul> |
| <li>Click a column heading to sort the order in which the issues are listed</li> |
| <li>Filter the displayed results by using the Filter dropdown list</li> |
| <!-- <li>Mark issues as seen or unseen by toggling the flag</li>--> |
| <li>Retrieve the most recent list of issues by clicking Refresh</li> |
| </ul> |
| <p class="tips">Click Modify Query in the Query tab to modify the search criteria of the saved query.</p> |
| |
| |
| |
| <a name="02b"></a> |
| <!-- ++++++++++++++ Viewing Issues ++++++++++++++ --> |
| <h3>Viewing and Updating an Issue</h3> |
| <p>In this exercise you will view and then modify the details of one of the issues of Anagram Game project. |
| </p> |
| |
| <p>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.</p> |
| |
| <p class="tips">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.</p> |
| |
| |
| <ol> |
| <li>Open the list of project issues.</li> |
| <li>Double-click Issue #257 <strong>Typo in StaticWordLibrary</strong> to view the issue details in the main window.</li> |
| <li>Make any changes to the issue details and add a comment. Click Submit Changes.</li> |
| </ol> |
| |
| <p>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.</p> |
| |
| <p class="notes"><strong>Note.</strong> 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.</p> |
| |
| |
| <img src="../../../images_www/articles/73/ide/issue-tracking/view-issue257.png" alt="Screenshot of issue open in Issues window" title="An issue open in Issues window" class="margin-around b-all"> |
| |
| |
| </div> |
| |
| |
| |
| |
| <!-- ++++++++++++++ Saving a search query ++++++++++++++ --> |
| |
| <!-- ++++++++++++++ New Issues ++++++++++++++ --> |
| |
| |
| <a name="04"></a> |
| <h2>Reporting a New Issue</h2> |
| <p>This section demonstrates how to submit a new issue for the Anagram Game project from within the IDE.</p> |
| |
| <p>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.</p> |
| |
| <p class="notes"><strong>Note.</strong> 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.</p> |
| |
| |
| |
| <p>To report a new issue for the Anagram Game project, perform the following steps.</p> |
| |
| <ol> |
| <li>Choose Team > Report Issue from the main menu to open the Report a New Issue window.</li> |
| <li>Select the tracker from the Issue Tracker dropdown list.</li> |
| <li>Select the project from the Product dropdown list.</li> |
| <li>Specify the issue details, summary and description. Click Submit Issue.</li> |
| </ol> |
| |
| <p>When you click Submit Issue, the IDE submits the issue to the tracker.</p> |
| |
| <p class="notes"><strong>Note.</strong> In this example you will not be able to submit |
| the issue because you are not a member of the project.</p> |
| |
| |
| |
| <a name="05"></a> |
| <!-- ++++++++++++++ Stack Traces ++++++++++++++ --> |
| |
| <h2>Working with Stack Traces</h2> |
| <p>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. |
| </p> |
| <p class="notes"><strong>Note.</strong> 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. |
| </p> |
| |
| <ol> |
| <li>Open Issue 1446 <strong>Cannot start AnagramGame due to NullPointerException</strong>. |
| <p>Issue 1446 of the Anagram Game project states that a NullPointerException is thrown when you run the application.</p></li> |
| <li>In the issue description, click on the following line in the stack trace. |
| <pre class="examplecode">com.toy.anagrams.ui.Anagrams$2.windowOpened(Anagrams.java:72)</pre> |
| <p>The issue description contains a copy of the stack trace that was copied from the Output window.</p> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/stack-trace.png" alt="Screenshot of issue showing stack trace" title="An issue open in the IDE and showing a stack trace in the issue description" class="margin-around b-all"> |
| </ol> |
| |
| <p>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.</p> |
| <p class="notes"><strong>Note.</strong> The IDE can open the local file because you checked out the sources earlier in this tutorial.</p> |
| |
| <p class="tips">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.</p> |
| |
| <img src="../../../images_www/articles/73/ide/issue-tracking/output-exception.png" alt="Screenshot of Output window that shows stack trace" title="Stack trace in Output window after running the project" class="margin-around b-all"> |
| |
| |
| |
| |
| <!-- ++++++++++++++ Patch Files ++++++++++++++ --> |
| <a name="06"></a> |
| <h2>Opening and Applying a Patch File</h2> |
| <p>In this section you will view an attached patch file and then apply the patch.</p> |
| |
| <p>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.</p> |
| |
| <ol> |
| <li>Open Issue 1446 <strong>Cannot start AnagramGame due to NullPointerException</strong>.</li> |
| <li>Click the name of the patch file that is attached to the issue.<br clear="all"> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/issue-patch.png" alt="Screenshot of issue window showing attached patch" title="Patch that is attached to an issue" class="margin-around b-all"> |
| <p>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 <tt>StaticWordLibrary.java</tt>.</p> |
| <pre class="examplecode">- static WordLibrary DEFAULT; |
| + final static WordLibrary DEFAULT = new StaticWordLibrary();</pre> |
| <p>Close the patch file.</p> |
| </li> |
| <li>In the window for the issue, click <strong>apply</strong> next to the name of the attached patch file to open the Apply Patch dialog box.</li> |
| <li>Expand the Anagram Game project and select the Source Packages directory in the Apply Patch dialog. Click Apply.<br clear="all"> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/apply-patch.png" alt="Screenshot of Apply Patch dialog" title="Source Packages node selected in Apply Patch dialog box" class="margin-around b-all"> |
| <p class="notes"><strong>Note.</strong> 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.</p></li> |
| </ol> |
| <p>When you click Apply, the IDE applies the patch and modifies <tt>StaticWordLibrary.java</tt>. |
| 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.</p> |
| |
| |
| <!-- ++++++++++++++ Version Control ++++++++++++++ --> |
| |
| <a name="07"></a> |
| <h2>Integration with Version Control</h2> |
| <p>In this section you update an issue as part of the process of committing a change to the sources of the Anagram Game project.</p> |
| |
| <p>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.</p> |
| |
| <p>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.</p> |
| |
| <p class="tips">For details on using Subversion in NetBeans IDE, see the |
| <a href="http://www.netbeans.org/kb/docs/ide/subversion.html">Guided Tour of Subversion</a>.</p> |
| <p class="tips">For more about Kenai support for version control systems, see the Kenai documentation on |
| <a href="http://kenai.com/projects/help/pages/SourceControl">Source Code Management</a>.</p> |
| |
| |
| <p>This exercise demonstrates how to update an issue as part of the commit process.</p> |
| |
| <ol> |
| <li>Expand the <tt>com.toy.anagrams.lib</tt> package under the Source Packages node in the Projects window. |
| <br> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/projects-window.png" alt="Screenshot of Projects window that shows project under version control" title="Projects window that shows project under version control" class="margin-around b-all"> |
| |
| <p>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.</p> |
| </li> |
| <li>Right-click the <tt>StaticWordLibrary.java</tt> file and choose Subversion > Commit to open the Commit dialog.</li> |
| <li>Enter a Commit Message that describes the commit.</li> |
| <li>Expand the Update Issue panel in the Commit dialog.<br> |
| <img src="../../../images_www/articles/73/ide/issue-tracking/commit-dialog.png" alt="Screenshot of Commit dialog" title="Commit dialog box that shows commit options" class="margin-around b-all"> |
| </li> |
| <li>Select the issue tracker for the Anagram Game project from the dropdown list (if not selected).</li> |
| <li>Type <strong>1446</strong> in the Issue field. |
| <p>The changes to <tt>StaticWordLibrary.java</tt> that you are committing will fix the exception reported in Issue 1446.</p> |
| <p class="tips">You can type the issue id (<strong>1446</strong>) or some text contained |
| in the issue description (<strong>NullPointerException</strong>) in the Issue field. |
| The IDE will display a list of issues that match the text.</p></li> |
| <li>Select the <strong>Resolve as FIXED</strong> checkbox. |
| <p>Selecting Resolve as FIXED will change the status of the issue to Resolved.</p> |
| </li> |
| <li>(Optional) Select <strong>Add details to commit message and issue</strong> to add additional details. |
| You can click <strong>modify</strong> to open a dialog that enables you to modify how the additional details are formatted. |
| </li> |
| <li>Click Commit.</li> |
| </ol> |
| <p>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.</p> |
| |
| <p class="notes"><strong>Note.</strong> In this example you will not be able to commit |
| the changes because you are not a member of the project.</p> |
| |
| |
| |
| |
| <p>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.</p> |
| |
| <p>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.</p> |
| |
| |
| <div class="feedback-box"><a href="/about/contact_form.html?to=3&subject=Feedback:%20Working%20with%20Issue%20Tracking%20in%20NetBeans">Send Feedback on This Tutorial</a></div> |
| <br style="clear:both;"> |
| |
| <h2>See Also</h2> |
| <p>For additional information on using NetBeans IDE in a collaborative environment, see the following tutorials.</p> |
| <ul> |
| <li><a href="../../docs/ide/team-servers.html">Working With a Team Server in NetBeans IDE</a></li> |
| <li><a href="../../docs/ide/subversion.html">Guided Tour of Subversion</a></li> |
| <li><a href="../../trails/tools.html">Integration with External Tools and Services</a></li> |
| </ul> |
| |
| |
| </body> |
| </html> |