Edit Comment Plugin

This plugin is redundant as of JIRA 3.8, where comments can be edited
Name Edit Comment Plugin
Version 0.5
Product Versions 3.6.x - 3.7.x (note: comments are editable already in 3.8+)
Author(s) Philip Herbst
Homepage  
Price FREE
License  
JavaDocs  
IssueTracking  
Download JAR 3.7.x edit-comment-plugin-0.5.jar
3.6.x edit-comment-plugin-0.4.jar
Download Source http://svn.atlassian.com/svn/public/contrib/jira/jira-edit-comment-plugin/trunk/

Description/Features

A Plugin that allows the author of the last Comment to edit his comment. A combination of a Issue Operation and a WebWork Plugin.

  • History Entry is written
  • Issue Commented Event is thrown

Usage

1. Just put edit-comment-plugin-0.5.jar in you WEB-INF/lib folder
2. Start Jira

If you are the author of the last comment, you will see a link under Operations

Follow the link and edit

Change History

Examples

Although its only possible to edit the last comment from the UI, you can enter the commentId from an older Comment. The only restriction is that you must be the author of the comment.

/secure/EditComment!default.jspa?id=10002&commentId=10042

id = id of Issue
commentId = id of comment (you can look it up from the delete/permlink hyperlinks)

Version History

0.5

edit-comment-plugin-0.5.jar

  • compatibility with 3.7
  • works with project roles and group level visibility

0.4

edit-comment-plugin-0.4.jar

  • Option to suppress notification
  • i18n support for Issue Operation Plugin
  • minor cosmetic issue (tooltips)

0.3

edit-comment-plugin-0.3.jar

  • Introduced param "onlyLastComment" in atlassian-plugin.xml which restricts comment edits to last comment
  • now records if the visibility has changed
  • unless the visibility is set to anyone the comment body is not recorded to the change history since there is no way to hide a entry here
  • workaround for "decorator" problem - see comments 

0.2

edit-comment-plugin-0.2.jar

  • All comments are now visible on action page
  • All comments where you are author are editable 

 

0.1

First Release 

Open Issues

Screenshots

Screenshots
(view as slideshow)
       
       
 
         
    Title shows JIRA instead of my company name      
 

Labels

 
  1. Aug 03, 2006

    Nick Menere says:

    Philip, looks nice, might have to give this one a spin. (and I think you may be...

    Philip,
    looks nice, might have to give this one a spin. (and I think you may be very popular amounst other customers).

    Cheers,
    Nick

  2. Aug 04, 2006

    Christoph Seyfert says:

    Hi, i had installed the plugin in my jira testsystem (Enterprise Edition, Versio...

    Hi,
    i had installed the plugin in my jira testsystem (Enterprise Edition, Version: 3.6.2-#156 standalone) and get the following error in the catalina.out logfile.

    01.08.2006 05:57:12 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    01.08.2006 05:57:12 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    2006-08-01 05:57:26,673 ERROR [ContainerBase.[Catalina].[localhost].[/]] Exception sending context initialized event to listener instance of class com.atlassian.jira.upgrade.ConsistencyLauncher
    java.lang.UnsupportedClassVersionError: de/phil/jira/plugin/editcomment/EditCommentIssueOperation (Unsupported major.minor version 49.0)

    has somebody any hints for me ?

    Cheers,
    Christoph

    1. Aug 04, 2006

      Justin Koke says:

      The jar file has been built with 1.5 (looking at the Manifest file). I am assumi...

      The jar file has been built with 1.5 (looking at the Manifest file). I am assuming you are using 1.4, I would suggest upgrading to 1.5, or once the source has been distributed, recompiling it with 1.4

      Regards,
      Justin

  3. Aug 04, 2006

    Philip Herbst says:

    Yeah, I forgot "maven clean" and the auto built class from my IDE was catched up...

    Yeah, I forgot "maven clean" and the auto built class from my IDE was catched up (which is configured for 1.5). The new attached jar should now work for >1.3. The source is now also available, see the link on top of the page.

    Cheers,

    Phil 

  4. Aug 12, 2006

    Neal Applebaum says:

    Phil I unzipped the new jar file and I noticed line 17 of atlassianplugin.xml sa...

    Phil - I unzipped the new jar file and I noticed line 17 of atlassian-plugin.xml says:

                    <view name="success">/templates/issue-datails.vm</view>

    Aside from the typo (datails instead of details), I don't see that file (of either spelling) exists, either in the standard source or your add-on.

    1. Aug 12, 2006

      Philip Herbst says:

      Neal, I was testing a bit&nbsp; and this is probably left. It should not be the...

      Neal,

      I was testing a bit  and this is probably left. It should not be there anymore but  should not affect the plugin itself. I am not sure why its still there, because in the current atlassian-plugin.xml it is not.

      see here http://svn.atlassian.com/svn/public/contrib/jira/jira-edit-comment-plugin/trunk/src/etc/atlassian-plugin.xml

      You can take it from there or correct it manually if you want. I will shortly upload a correct version, but I havent got my computer/tools here

      Phil

  5. Aug 14, 2006

    Neal Applebaum says:

    Hi Phil I found a little bug in the version I have installed (0.1). when editing...

    Hi Phil - I found a little bug in the version I have installed (0.1). when editing the comment, the name of my company does not display. Instead, it displays as "JIRA" (above the Issue Details pane). Preferably that whole section shouldn't display.

    1. Aug 14, 2006

      Philip Herbst says:

      Could you please provide a screenshot? I am not able to reproduce this or I dont...

      Could you please provide a screenshot? I am not able to reproduce this or I dont quite understand. And secondly, do you mean that the whole Issue Details pane should not display?

      1. Aug 15, 2006

        Neal Applebaum says:

        I attached a screenshot showing the problem. Instead of my company name, it just...

        I attached a screenshot showing the problem. Instead of my company name, it just says "JIRA". As to the left pane, what would be ideal is that it displays the same way as when you delete a comment, with a Comment Details section.

        1. Aug 15, 2006

          Philip Herbst says:

          Neal, I'm stuck here. I can't&nbsp; replicate it and I dont even know why it sho...

          Neal,

          I'm stuck here. I can't  replicate it and I dont even know why it should display. I have looked at the template editComment.vm but could not find a place where this could be located. I have downloaded edit-comment-plugin-0.1.jar from here and tested it with JIRA 3.6 and 3.6.3. Strange

          Which Version of JIRA are you using? 

  6. Aug 15, 2006

    Neal Applebaum says:

    Actually, on second thought, what displays onthe left pane is fine.

    Actually, on second thought, what displays onthe left pane is fine.

  7. Sep 28, 2006

    Carl Jones says:

    I downloaded the&nbsp;0.2 jar&nbsp;file, put it in the right place in jira, stop...

    I downloaded the 0.2 jar file, put it in the right place in jira, stopped and started it and now it is there.  When I add a comment, the Edit Comment appears immediately after my saving it.  However, when I click on Edit Comment, I get a url like this: https://jira.filmloop.net:8443/secure/EditComment!default.jspa?id=10029&commentId=16750&nbsp;and a page not found.  Any ideas?

    1. Sep 29, 2006

      Philip Herbst says:

      Hi, unfortunately the plugin doesnt work for Versions prior to JIRA 3.6.x. But ...

      Hi,

      unfortunately the plugin doesnt work for Versions prior to JIRA 3.6.x. But i uploaded a JAR edit-comment-plugin-0.1a.jar which works for 3.5.x. Could you try this?

      Cheers,
      Philip

  8. Sep 30, 2006

    Carl Jones says:

    It works\!(y) Thanks very much. &nbsp;&nbsp; \carl

    It works!

    Thanks very much.

       -carl

  9. Oct 19, 2006

    Rajendra says:

    Hi Philip, Is there any thought on making this feature available in Confluence ...

    Hi Philip,

    Is there any thought on making this feature available in Confluence too ?

    There is one similar feature request http://jira.atlassian.com/browse/CONF-830 pending in Confluence bucket for long time!

    -
    Rajendra

  10. Nov 02, 2006

    Jeff VanShaar says:

    Installed it, restarted Jira and the link appears now under the Operations, but ...

    Installed it, restarted Jira and the link appears now under the Operations, but when I click it I get the following error: 

    "Could not locate resource templates/editComment.vm "

    Using Enterprise 3.6.5 build 161 with edit-comment-plugin-0.2.jar.  When I open the jar, sure enough templates\editComment.vm exists. Any ideas?

    1. Nov 02, 2006

      Philip Herbst says:

      Hi, I tested with the Jira 3.6.5 Enterprise Standanlone Version and it seems to ...

      Hi,

      I tested with the Jira 3.6.5 Enterprise Standanlone Version and it seems to work. What application Server are you using?

      1. Nov 02, 2006

        Neal Applebaum says:

        I got the same problem. Works fine in standalone (Tomcat), but I got that error ...

        I got the same problem. Works fine in standalone (Tomcat), but I got that error running under Weblogic.

      2. Nov 02, 2006

        Jeff VanShaar says:

        Tomcat 5.5 as a webapp.

        Tomcat 5.5 as a webapp.

      3. Nov 02, 2006

        Neal Applebaum says:

        Here's the errors in the logs on startup: ERROR velocity ResourceManager : una...

        Here's the errors in the logs on startup:

        ERROR [velocity] ResourceManager : unable to find resource '/jira/templates/jira/issue/field/comment-edit.vm' in any resource loader.
        ERROR [velocity] #parse(): cannot find template '/jira/templates/jira/issue/field/comment-edit.vm', called from template templates/editComment.vm at (121, 7)
        ERROR [com.atlassian.velocity.DefaultVelocityManager] ResourceNotFoundException occurred whilst loading resource templates/editComment.vm
        
  11. Nov 02, 2006

    Neal Applebaum says:

    Line 121: #parse ("$req.contextPath/templates/jira/issue/field/commentedit.vm...

    Line 121:
    #parse ("$req.contextPath/templates/jira/issue/field/comment-edit.vm")
    so it must be the syntax describing context path when deployed under an app server.

    1. Nov 02, 2006

      Philip Herbst says:

      Hi, Neal you are on the right spot. I just figured it out almost at the same ti...

      Hi,

      Neal you are on the right spot. I just figured it out almost at the same time and replicated it with tomcat5.5... Just change the line to following

      #parse ("/templates/jira/issue/field/comment-edit.vm")

      Theres no need to specify the context path (my mistake). The reason it works for the standalone version is that the context path is "empty" (http://myserver.com <-> http://myserver.com/jira) by default. I also uploaded and replaced the v0.2 jar. I tested
      it with a WAR Version and tomcat5.5. As the Error Messages you described and i got locally here are same, it should work for you too, Neal.

      Cheers,

      Phil

      1. Nov 03, 2006

        Neal Applebaum says:

        Thanks Philip. Works great now. I'm sure Jeff will be happy too :) . When you g...

        Thanks Philip. Works great now. I'm sure Jeff will be happy too .

        When you get a chance, can you see if you can fix it so it doesn't display "JIRA" between the announcement banner and the issue details when viewing the comments? We use JIRA as a support system, and it's called "Helpdesk", so if they edit a comment, the clients might wonder what the big blue "JIRA" means. I've already attached a screenshot.

        Thanks again for this useful plug-in. Also, since your enhancement to edit any comment you've authored, you may consider changing the wording for the description (not the operation itself) from "Edit comment" to "Edit my comment(s)", and the name of your Confluence page from "Edit Last Comment" as well.

        One more enhancement you can ponder... when editing a comment's visibility, there is no record in the change history that the visibility of the comment was changed. Not a big deal.

        1. Nov 04, 2006

          Philip Herbst says:

          2 things 1. I cannot replicate the bug you describe. I need a little help here....

          2 things

          1. I cannot replicate the bug you describe. I need a little help here. Could you send me the HTML source from that page? BTW have you customized anything?

          2. I discovered that the edited comment is shown in the change history regardless of the visibility of the comment. In the case of a deleted comment, Atlassian prevents this by only recording the visibility level JRA-9394. So I guess theres no way to restrict the visibility of the change history. The solution would be to look for the new visibility level and only record the comment when theres no visibility level set. Would this be suitable?

          1. Nov 04, 2006

            Neal Applebaum says:

            Hi Philip, Regarding 1) You mean you don't get that big JIRA message above the ...

            Hi Philip,

            Regarding 1) You mean you don't get that big JIRA message above the comments? Here's the relevant HTML:

            <div onmouseover="recordInTip()" onmouseout="recordOutTip()" id="quicksearchhelp" class="informationBox"
                 style="display: none; text-align: center; width: 20em; position: absolute; top: 55px; right: 10px; padding: 0.5em;">
                Learn more about <a href="http://www.atlassian.com/software/jira/docs/v3.6.3/quicksearch.html?clicked=jirahelp" target="_jirahelp">Quick Search</a>
            </div>
            
            <table border=0 cellpadding=0 cellspacing=0 width=100% bgcolor=ffffff>
            <td valign=top>
            	<table cellspacing=0 cellpadding=5 border=0 width=100%><tr><td>
            
            		<h1 class="pagetitle">JIRA</h1>
            		<hr>
            
            		<table cellpadding=0 cellspacing=0 border=0 width=100%>
            <tr>
            <td bgcolor="f0f0f0" valign=top width=200>
            
            <table cellpadding=3 cellspacing=0 border=0 width=100%>
            <tr><td bgcolor=dddddd>
                <b>Issue Details</b>
            
            </td></tr>
            </table>
            

            The only customization I've done is:

            Change company banner colour from colour scheme to blue (JRA-9424)

            atlassian-jira\styles\dynamicCss.jsp
            line 43 to:
            	.pagetitle { color: #31289C; }
            

            which was suggested by ... ahem ... you

            Regarding 2) I know you can't hide the edit in change history. What I meant was some indicator showing visibility used to be "All Users" and now it's "QA Group". There's no precedent for that because you can't edit comments without your plugin. It's also a VERY LOW priority issue. But you strike me as a thorough person

            1. Nov 04, 2006

              Philip Herbst says:

              Yeah, I don't get the JIRA message above the comments. And I don't know were it ...

              Yeah, I don't get the JIRA message above the comments. And I don't know were it might come from. The view is rendered from editComment.vm. As you can see the view starts with the issue details (apart from the security check and setting a velocity variable)

              #if ($action.isAbleToComment())
              #set($baseurl = $req.contextPath)
              <table cellpadding=0 cellspacing=0 border=0 width=100%>
              <tr>
              <td bgcolor="f0f0f0" valign=top width=200>
              <table cellpadding=3 cellspacing=0 border=0 width=100%>
              <tr><td bgcolor=dddddd>
                  <b>#text("viewissue.subheading.issuedetails")</b>
              </td></tr>
              </table>

              What you could try is accessing the edit-comment page without being logged in (start editing a comment, copy the URL and then log out). I would be interesting if the JIRA heading is still rendered, because this way we could exclude that the bug has its origin in editComment.vm.Nothing after the security check

              #if ($action.isAbleToComment())
              should be rendered

              1. Nov 06, 2006

                Neal Applebaum says:

                Hi Philip. Yes the blue JIRA header still gets rendered when not logged in. How...

                Hi Philip.

                Yes - the blue JIRA header still gets rendered when not logged in. However, I was able to see that it only happens in a WAR deployed app. In standalone, it does not appear. So that must be a clue.

                Also, I changed the value "JIRA" to "Helpdesk" in decorators\insecure.jsp, and SURE ENOUGH, that's now what gets displayed when editing a comment (logged in or not). So, I am guessing that somewhere in your logic, it decides that the user is not logged in, and displays the insecure page, but later allows proceeding. And in standalone, it doesn't trigger the same code path as a WAR app.

                Regards,

                Neal

                1. Nov 09, 2006

                  Philip Herbst says:

                  Hi Neal, In my logic I don't care about decorators. I don't really know why the...

                  Hi Neal,

                  In my logic I don't care about decorators. I don't really know why the decorator is applied. The strange thing is that I can't replicate it. I also tested the WAR version on Tomcat and Jboss. No "success". The only way I can get the JIRA header visible is to force the insecure decorator. I applied the parameter decorator=insecure to the URL. But perhaps this could be a starting point to a solution. What you could try is to force another decorator. Simply add the decorator parameter to the URL -> decorator=navigator

                  http://myserver.com/secure/EditComment!default.jspa?id=10010&commentId=10001&decorator=navigator#action_10001

                  If this works I could provide a workaround.Change editOperation.vm

                  <img src='$req.contextPath/images/icons/bullet_creme.gif' height=8 width=8 border=0 align=absmiddle/>
                  <b><a href='$req.contextPath/secure/EditComment!default.jspa?id=${issue.id}&commentId=$!{comment.id}&decorator=navigator#action_$!{comment.id}'>Edit Comment</a></b><br>Edit comment

                  I'm further interested in knowing if it's a general problem with webwork plugins or something I'm doing wrong. Theres a built in webwork plugin. Could you try accessing it and see if the header shows here too? (just shows JIRA admins)

                  http://myserver.com/secure/PluginAdministrators.jspa

                  Last Question: Are you using https?

                  Ok, nuff said

                  Cheers,

                  Phil

                  1. Nov 10, 2006

                    Neal Applebaum says:

                    1) Did adding &decorator=navigator solve the problem? Yes, it did. &decorator=in...

                    1) Did adding &decorator=navigator solve the problem?
                    Yes, it did. &decorator=insecure replicates what I get when using your plugin (the JIRA message), while &decorator=navigator renders the page without it, both when logged in and not.
                    2) Did the same problem arise using the contact admins link?
                    No. It was fine.
                    3) Am I using https?
                    No.

                    Thanks, Philip. If you canpackage a new .jar I'll try it out.

                    There are some things that happen on Weblogic that don't happen with other app servers, for sure.

                    Cheers,

                    Neal

                    1. Nov 10, 2006

                      Philip Herbst says:

                      New Version editcommentplugin0.3.jar is online which fixes "decorator" problem ...

                      New Version edit-comment-plugin-0.3.jar is online which fixes

                      • "decorator" problem
                      • recording of visibility level
                      • change history security issues

                      Hope it works for you.

                      Cheers,

                      Phil

                      1. Nov 11, 2006

                        Neal Applebaum says:

                        Hi Philip. To let you know how the fix went ... the decorator problem is resolve...

                        Hi Philip. To let you know how the fix went ... the decorator problem is resolved for when you first press the link Edit Comment, but if you edit any other comment on the page, it re-appears. For now I've edited the name JIRA to my own company so at least when it displays it isn't JIRA.

                        However the change history is now showing the comment ID instead of the actual text, as it did in previous versions.

                        Cheers,

                        Neal

                        1. Nov 11, 2006

                          Philip Herbst says:

                          1. Forgot to adjust the edit link. I have replaced the jar 2. If theres a visibi...

                          1. Forgot to adjust the edit link. I have replaced the jar

                          2. If theres a visibility level set on comment I only record the ID. If the visibility is set to anyone I record both the comment body and the ID. Is that not ok for you?

                          1. Nov 11, 2006

                            Neal Applebaum says:

                            1. I've reinstalled the new version, then. Thanks! 2. I see you've taken the app...

                            1. I've reinstalled the new version, then. Thanks!
                            2. I see you've taken the approach of JRA-9394. I forgot they addressed that. I deleted a comment viewable by 'QA' and it left this: "A comment with security level 'QA' was removed ".
                            Maybe it should only hide the comment text if the security has changed. Anyway, it's not a big deal.

                            Thanks!

                            1. Nov 11, 2006

                              Neal Applebaum says:

                              Philip I take back my comments above. I just realized that if I edit a comment v...

                              Philip - I take back my comments above. I just realized that if I edit a comment viewable by Staff only, then no-one outside of staff should see the comment text by viewing change history. You've done it right! Now take the weekend off!

        2. Nov 04, 2006

          Jeff VanShaar says:

          Sure enough. It is working now. Thanks for the plugin

          Sure enough. It is working now. Thanks for the plugin