WorklogListener - Modify the creation time for a worklog

Workloglistener will no longer be maintained since editable worklogs in Jira 3.10 has been introduced. 

JAWorkLogListener listens to all worklogs events. If a comment to a worklog contains a string [Date: dd.MM.yyyy HH:mm]  (or any other date format of your choice) the worklog Created field will be updated with the specified date.
See  JRA-2411




  1. Download and copy jira-plugin-jaworkloglistener.jar to the WEB-INF/lib directory.
  2. Open the 'Listeners' menu in Jira.
  3. Add a new Listener with Name: [any name] Class: com.ja.jira.plugin.listener.JAWorkLogListener
  4. Optional. Edit the listener:
    • Specify the input and output date format to use. See SimpleDateFormat API from SUN
    • Specify the number of days a user can do backward and forward logging.

Using the Listener:
Now when your make a new worklog you simply just specify [Date: dd.MM.yyyy HH:mm] in the worklogs comment field.

Example:
A worklog registered the 14th February 2006 20.26 with the comment "Fixed the bug in Santa's CRM. [Date: 24.12.2005 13:00]"


 
Result:
The worklog will have the date 24th December 2005 13:00 and the worklog comment will have the bodytext: "Fixed the bug in Santa's CRM. [Created: 14.02.2006 20:26]"


 
Configuration, Hints and comments:

  • If you don't specify an outputformat the listener will use the specified inputformat.
  • If you don't specify the inputformat the listener uses a 'home-made' format: dd-MM-yyyy HH:mm. Here you can use any non-digit character as separation and all values will be interpreted as numeric values. (That is 02.12.06 equals 2.12.6)
  • If you don't specify hours and minutes, 12.00 is default.
  • If you don't specify a Allowed_Frame_of_Days_Backward_Logging, users can log any arbitrary date in the past.
  • If you don't specify a Allowed_Frame_of_Days_Forward_Logging, users can log any arbitrary date in the future.

Comes of course with no warranty what so ever, but comments and bug reports are welcome.

Versions

Jira Version Jar
3.9.x jira-plugin-jaworkloglistener.jar
3.8.x jira-plugin-jaworkloglistener.jar
3.6.x jira-plugin-jaworkloglistener.jar


 

IssueTracking: http://developer.atlassian.com/jira/browse/WLL

Cheers,
Jes

Labels

plugin plugin Delete
cleanup cleanup Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 07, 2006

    Bettina Zucker says:

    Hello Jes, I tried using the following inputformat (and the same as outputformat...

    Hello Jes,

    I tried using the following inputformat (and the same as outputformat) values:

    dd/MMM/yy hh:mm a

    dd/MMM/yyyy hh:mm a

    But they did not work. Instead the format dd.MM.yyyy HH:mmwas always accepted, independently of the formats specified in the configuration. I'm using as a test system Jira 3.5.1 enterprise standalone on Windows.

    Cheers

    Bettina Zucker 

    1. Mar 09, 2006

      Jes A says:

      Bettina, Well, that's definitely not how it should work. It seems like the speci...

      Bettina,

      Well, that's definitely not how it should work. It seems like the specified date format is ignored. I'll look into it.

      /Jes

    2. Mar 09, 2006

      Jes A says:

      Bettina, You were quite right it didn't accept the user specified format. But th...

      Bettina,

      You were quite right - it didn't accept the user specified format. But that should be fixed now.
      Thanks for your response.

      Please notice that it is in a jar now, and should be placed in the WEB-INF/lib folder.
      When adding the listener one should use the Class: com.ja.jira.plugin.listener.JAWorkLogListener

      /Jes

      1. Mar 10, 2006

        Bettina Zucker says:

        Hello Jes, thank you for the correction. I tested it and now it works perfectly....

        Hello Jes,

        thank you for the correction. I tested it and now it works perfectly.
        It was a good idea to package it in a .jar!

        Cheers

        Bettina 

  2. Mar 07, 2006

    Matt Kenigson says:

    Why is this page not linked from the extensions home?

    Why is this page not linked from the extensions home?

    1. Mar 07, 2006

      Jonathan Nolen says:

      It is now. jn

      It is now. -jn

  3. Apr 13, 2006

    Matt Kenigson says:

    Something is wrong.  I cannot download the attachmed jar.  Clicking on...

    Something is wrong.  I cannot download the attachmed jar.  Clicking on it gives me this error:

    java.lang.RuntimeException: Attachment data not found where expected
     at
    com.atlassian.confluence.pages.DefaultAttachmentManager.getAttachmentData(Lcom/atlassian/confluence/pages/Attachment;)Ljava/io/InputStream;(DefaultAttachmentManager.java:36)
    
                            caused
    by: com.atlassian.confluence.pages.AttachmentDataNotFoundException:
    Problem while getting attachment stream from file system
     at
    com.atlassian.confluence.pages.persistence.dao.FileSystemAttachmentDataDao.getDataForAttachment(Lcom/atlassian/confluence/pages/Attachment;)Ljava/io/InputStream;(FileSystemAttachmentDataDao.java:84)
    
                            caused
    by: java.io.FileNotFoundException:
    /var/lib/pgsql/opt/j2ee/domains/atlassian.com/confluence/webapps/atlassian-confluence/data/attachments/162015/5596:
    No such file or directory
     at jrockit.io.FileNativeIO.open0(Ljava/lang/String;I)I(Unknown Source) 

    PS - It's cool that the system's favorite color is Chartreuse...

    1. Apr 14, 2006

      Jes A says:

      Seems to be a generally problem, all images is 'lost' as well. Hope that Atlassi...

      Seems to be a generally problem, all images is 'lost' as well.

      Hope that Atlassian will take care of it.

      /Jes

  4. Apr 18, 2006

    Brian Nguyen says:

    Hi Everyone, It seems like some of the attachments were lost during an upgrade. ...

    Hi Everyone,

    It seems like some of the attachments were lost during an upgrade. We're currently looking into the problem, and hopefully all the files will be back up soon.

    Thanks,
    Brian

  5. Apr 19, 2006

    Christopher Owen says:

    Sorry about that folks. The attachments have been restored.

    Sorry about that folks. The attachments have been restored.

  6. May 23, 2006

    Bettina Zucker says:

    HelloJes, I have to upgrade to Jira 3.6.x so I tested this plugin with a test in...

    HelloJes,

    I have to upgrade to Jira 3.6.x so I tested this plugin with a test installation of Jira 3.6.1 enterprise.

    The plugin did not work. I used the standard format_:  [Date: dd.MM.yyyy HH:mm]_
    The string was left in the comment and the worklog's date is today.

    I got some error messages:

    2006-05-23 15:17:01,008 ERROR [velocity] RHS of #set statement is null. Context will not be modified. templates/plugins/portlets/issuesummaryfastworklog.vm [line 23, column 1]
    2006-05-23 15:17:01,101 ERROR [velocity] ASTMethod.execute() : exception invoking method 'getPrettyDuration' in class com.atlassian.jira.issue.helper.WorklogHelper : java.lang.IllegalArgumentException: argument type mismatch
    2006-05-23 15:17:01,148 ERROR [velocity] RHS of #set statement is null. Context will not be modified. templates/plugins/portlets/issuesummaryfastworklog.vm [line 26, column 1]
    2006-05-23 15:17:59,351 ERROR [velocity] RHS of #set statement is null. Context will not be modified. templates/plugins/portlets/issuesummaryfastworklog.vm [line 23, column 1]
    2006-05-23 15:17:59,351 ERROR [velocity] ASTMethod.execute() : exception invoking method 'getPrettyDuration' in class com.atlassian.jira.issue.helper.WorklogHelper : java.lang.IllegalArgumentException: java.lang.ClassCastException@d5a86c
    2006-05-23 15:17:59,445 ERROR [velocity] RHS of #set statement is null. Context will not be modified. templates/plugins/portlets/issuesummaryfastworklog.vm [line 26, column 1]
     

    At the moment I'm considering just not installing the plugin in 3.6.x, since worklogs were not accepted by our users yet.
    They are still too complicate. So I'm not requesting you to correct the plugin, just wanted to tell you about my negative test result.

    Cheers

    Bettina Zucker 

    1. May 23, 2006

      Jes A says:

      Hi Bettina, Added a version for 3.6. Minor change, had just not thought about up...

      Hi Bettina, Added a version for 3.6. Minor change, had just not thought about uploading it.
       Could be great if Atlassian would put in some effort in strengthen the worklog functions. . .
       /Jes

  7. Jun 02, 2006

    Jorg Heymans says:

    The listener for 3.6.x seems to be broken : on the log work page, i put in 22m, ...

    The listener for 3.6.x seems to be broken : on the log work page, i put in 22m, and as comment i put in [Date: 01/02/2006]. When looking at the work log overview in the ticket i get:

    Time Worked: 22 minutes [Created: 02/35/2006]    -> i don't think that's a legal date

    The listener is configured as dd/mm/yyyy, using Jira Enterprise Edition, Version: 3.6.1-#154

    1. Jun 02, 2006

      Jes A says:

      Try using M (Month) instead of m (minutes). Pobably why the date is incorrect. /...

      Try using M (Month) instead of m (minutes).
      Pobably why the date is incorrect.
      /Jes

      1. Jun 06, 2006

        Jorg Heymans says:

        Well spotted, that did the trick thanks \!

        Well spotted, that did the trick thanks !

  8. Aug 07, 2006

    DI Peter Burgstaller says:

    Hi, the workloglistener seems to not work with my jira 3.6.x installation anymor...

    Hi,

    the workloglistener seems to not work with my jira 3.6.x installation anymore. The jar is in the WEB-INF/lib directory, I can add the listener to the listeners in the admin page and have specified
    When I now add a worklog with this date format, the result looks like this:

    Work logged by Administrator [08/Aug/06 06:45] [ Permlink ]
    Time Worked: 2 hours
    [Date: 1.8.2006 20:00]

    Hence, no change to the date has been made. I tried [Date: 01.08.2006 20:00] and [Date: 1.8.2006 20:00]. Still no change. Any advise would be greatly appreciated. We are heavily using this feature for getting accurate worklogs.

    Thanks!

    - Peter 

    1. Aug 08, 2006

      Jes A says:

      Peter, Try downloading this jar jaworkloglistener.jar\ should work. cheers, Jes

      Peter,

      Try downloading this jar - should work.

      cheers,

      Jes

  9. Oct 06, 2006

    Vlad says:

    Hi we installed this plugin recently and we have had a problems with it. When en...

    Hi we installed this plugin recently and we have had a problems with it.

    When entering time into the system the date we specified would be increased by 12 hours for an unknown reason.
    For example, when entering [Date: 05/10/06 20:00] the worklog would be logged at 8:00 and the date would be increased by one. So it would be logged as 06/10/06 8:00

    We got around this by specifying an input format at the edit listener page but I just wanted to bring it to your attention.
      

    1. Oct 07, 2006

      Jes A says:

      This bug is probably related to the date format on the webserver, because I can'...

      This bug is probably related to the date format on the webserver, because I can't reproduce it.

      Anyway, I think the new JAR attached will resolve it. The listener is now using Calendar. HOUR_OF_DAY instead of Calendar.HOUR to set the hour. Pretty sure that's the source of the bug.

      Download this jar, jira-plugin-jaworkloglistener.jar. Remember to delete the old jar.

      /Jes

  10. Oct 06, 2006

    Vlad says:

    The above is in JIRA 3.6.4 build 160

    The above is in JIRA 3.6.4 build 160

  11. Nov 16, 2006

    Zhang Mingquan Mike says:

    The Date should be strictly validated, for example, someone can even fill their ...

    The Date should be strictly validated, for example, someone can even fill their worklog years ago or later. That's unreasonable.

    1. Nov 16, 2006

      Jes A says:

      Well for some it could be unreasonable for others not. But the challenge is that...

      Well for some it could be unreasonable - for others not.
      But the challenge is that you only have one shot - it's a listener. You can't edit it afterwards.
      So if one is using an invalid date, he/she can't undo it, edit it or something like that.

      I could add parameters to the listener configuration where one can specify the relative number of days from "to day" one is allowed to log work. Would that make sense?

      1. Nov 16, 2006

        Jeff Guthrie says:

        Yes that makes sense.  All these workarounds and plugins to fix some founda...

        Yes that makes sense.  All these workarounds and plugins to fix some foundational functionality to project management (time tracking) seem a bit ridiculous.  Hopefully someone at Atlassian is listening to get this issue of time tracking fixed.  I very much appreciate your work at solving this Jes!

        1. Nov 18, 2006

          Jes A says:

          Couldn't a agree more (about it seems a bit ridiculous). I have a feeling that A...

          Couldn't a agree more (about it seems a bit ridiculous). I have a feeling that Atlassian has more focus at Confluence.

    2. Nov 18, 2006

      Jes A says:

      A new version is available. When setting up the listener one can specify the num...

      A new version is available. When setting up the listener one can specify the number of allowed days to log work, backward and forward.

  12. Jan 11, 2007

    Nathan Hill says:

    Hi Jes, Can you confirm whether or not this plugin is working in version 3.7.1?&...

    Hi Jes,

    Can you confirm whether or not this plugin is working in version 3.7.1?  I've just upgraded and reinstalled this and it's not functioning as expected.  It's almost as if the listener is being ignored?

    Cheers

    1. Jan 12, 2007

      Jes A says:

      Hi Nathan, It's not working with 3.7.x because of changes in the API. I'm uncert...

      Hi Nathan,

      It's not working with 3.7.x because of changes in the API. I'm uncertain that I can bring it to work in 3.7 since a worklog, apparently , no longer can be edited and saved. Maybe the Atlassians developers has a solution - I'll ask them and be back with an answer.

      1. Jan 18, 2007

        Dharmendra Varma says:

        Hi Jes Any update on this as this is very important feature for us.

        Hi Jes

        Any update on this as this is very important feature for us.

    2. Jan 19, 2007

      Jes A says:

      Hi, I will probably be able to upload a 3.7 compliant version within January. Cr...

      Hi, I will probably be able to upload a 3.7 compliant version within January.

      Cristoph Ertl has crated a modified version of the workloglistener, the source can be downloaded here: http://forums.atlassian.com/message.jspa?messageID=257240473#257240473
      Should also work with 3.7.
      Cheers.

      1. Jan 24, 2007

        Frank Knobloch says:

        We just start evaluation JIRA (3.7) and the feature that workloglistener provide...

        We just start evaluation JIRA (3.7) and the feature that workloglistener provides is a MUST for us. Or will there be another way to store worklogs for the past? If i'm right the reporter plugins Timesheet and so on just analyze this worklogs. But what's up when im working with no JIRA access. I have to fill out my worklogs later. I don't know why this feature is underestimated.

        Ok, i found the source from Christoph but i don't know how to handle it. I need additional packages if i'm right. I have to build and als this stuff. But i'm a user, no engineer, no programmer.

        Will there be solution for JIRA 3.7 as an installable plugin/listener in the next days or are there other hints how to compile the source or how to manage worklogs from the past.

         Regards

        Frank

  13. Jan 29, 2007

    Jeff Guthrie says:

    Jes, does your worklog listener work with 3.7? Our company is looking at JIRA ag...

    Jes, does your worklog listener work with 3.7? Our company is looking at JIRA again but may not get it because of this weak time tracking issue.

    1. Jan 29, 2007

      Jes A says:

      Unfortunately, it doesn't. But it will in some time. Meanwhile perhaps you can u...

      Unfortunately, it doesn't. But it will in some time. Meanwhile perhaps you can use this, from Cristoph http://forums.atlassian.com/message.jspa?messageID=257240473#257240473

  14. Feb 13, 2007

    Morgan Nilsson says:

    Any progress with 3.7.3?

    Any progress with 3.7.3?

  15. May 18, 2007

    Nathan Hill says:

    Hi Jes, Is this working in Version 3.9?  Can't seem to get it going? Cheers

    Hi Jes,

    Is this working in Version 3.9?  Can't seem to get it going?

    Cheers

    1. May 18, 2007

      Jes A says:

      Hi Nathan, Just did a brief test and it should work. Atlassian has apparently de...

      Hi Nathan,

      Just did a brief test and it should work.

      Atlassian has apparently decided to release new version once every two weeks or so. Making it quite difficult to keep plugins up to date.

      Cheers Jes

      1. May 21, 2007

        Nathan Hill says:

        Hi Jes, I've been trying to get this going again in Version 3.9 for a while tryi...

        Hi Jes,

        I've been trying to get this going again in Version 3.9 for a while trying a number of things, however I can't seem to get it going.  I have set it up as follows:

        Worklog Listener
        com.ja.jira.plugin.listener.JAWorkLogListener
          InputDateAndTimePattern dd.MM.yyyy HH:mm
        OutputDateAndTimePattern dd.MM.yyyy HH:mm  

        I've had this successfully working in earlier versions, so I don't think that I have mucked it up.

        Can you please have a look at this for me in Version 3.9?

        Regards,

        Nathan

        1. May 22, 2007

          Jes A says:

          Lets track this issue here: