User filter on Timesheet gadget and Time Sheet Report not working

Issue #347 resolved
Former user created an issue

My timesheet gadget shows no time tracking record for a given week. This is the same with Time Sheet Report if the user filter is filled in.

When I delete the user id from the report filters, it will bring up the logged time correctly. But also brings other user's data as well.

The main scenario is the following: we need a report grouped by "Jira task summary", so if a user works and logs several days on the same task, the group summary will show the daily sum in one row per task.

Since the user filter is not working, we cannot achieve this result.

Comments (31)

  1. Andriy Zhdanov

    You don't need to 'group by summary', gadget aggregates work by issue, similarly in report if Show Details unchecked.

    Also if you don't specify user, both gadget and report will show data for currently logged in user only, unless you specify project, role or group.

    Does it help for your scenario?

    But if you want to see data for other user than yourself, please specify username in lowercase, and see if it helps.

    Thank you.

  2. Former user Account Deleted

    I understand, but as I can see,

    1. if the logged in user is a project admin, or a task reporter, he will see other users' time reports as well .../ConfigureReport.jspa?startDate=2013.04.08&endDate=2013.04.12&targetUser=&targetGroup=&priority=&projectid=10300&filterid=&projectRoleId=&weekends=true&groupByField=&moreFields=&selectedProjectId=10300&reportKey=jira-timesheet-plugin%3Areport&Next=Next

    2. if therefore I fill in the user filter and start typing the name, the field will pick up the proper name from the user list (which is an external user in ldap directory), but the query won't show any data at all (regardless of the user id filled in lowercase or not) .../ConfigureReport.jspa?startDate=2013.04.08&endDate=2013.04.12&targetUser=u50563&targetGroup=&priority=&projectid=10300&filterid=&projectRoleId=&weekends=true&groupByField=&moreFields=&selectedProjectId=10300&reportKey=jira-timesheet-plugin%3Areport&Next=Next

    3. if I select "All projects" and no user name specified, the query result will be still empty .../ConfigureReport.jspa?startDate=2013.04.08&endDate=2013.04.12&targetUser=&targetGroup=&priority=&projectid=&filterid=&projectRoleId=&weekends=true&groupByField=&moreFields=&selectedProjectId=10300&reportKey=jira-timesheet-plugin%3Areport&Next=Next

    4. same with "All projects" and user name filter, no data *.../ConfigureReport.jspa?startDate=2013.04.08&endDate=2013.04.12&targetUser=U50563&targetGroup=&priority=&projectid=&filterid=&projectRoleId=&weekends=true&groupByField=&moreFields=&selectedProjectId=10300&reportKey=jira-timesheet-plugin%3Areport&Next=Next *

    So I don't know where to go further.

  3. Andriy Zhdanov
    1. This is because you specified project, see projectId=10300, try 'All Projects' instead, however see also point 3 related to this.

    2. Here might be some problem. Is u50563 valid username? If you use userpicker, what value does it provide?

    3. This looks weired, if 1 works. I guess user from active directory is logged, in the case and it makes the difference?

    4. Might be same problem as 2, but this time I can see uppercase U50563. Wonder if there is other username for this userid? Something like you've used in gadget KRU...N. But lower case also.

    Thank you.

  4. Former user Account Deleted

    Andriy,

    1. Yes, it is valid. We use an external directory server (LDAP), and no Crowd. We use the LDAP Permission in Jira: "Read Only, with Local Groups" and a given LDAP group is synchronized into JIRA. The JIRA username is an alphabet+number (actually it is a user id), and the JIRA Full name contains the proper name.

    In user picker, if I write the Full name, it will change it to the user name you can see in the query string. (Lowercase and uppercase is mixed above, because I was experimenting what you suggested before (writing username in lowercase)).

    1. I checked the JIRA table WORKLOG, and the AUTHOR and UPDATEAUTHOR attributes contain the above mentioned username (LDAP userid). As I have seen JIRA is case-insensitive regarding the userid (starting with 'u' or 'U' brings up the same user in the user picker).

    What do you think? My colleagues told me, it was working before. I don't know however with which version.

  5. Former user Account Deleted

    No. It is not. It is uppercase. And it is also uppercase in the user list, I mean if I check in JIRA Admin the Users menu. (Actually there was a migration from an old LDAP to a newer one in 2012, so there are a couple of records in Worklog - not much - with lower case, but all of them in the given time frame which you can see in the query string are uppercase.)

  6. Former user Account Deleted

    I checked the cwd_user table, just to make sure. There are some users (not all of them), where username exists with lower and uppercase, and for them the LOWER_USER_NAME attribute is the same, of course. These users point to a different DIRECTORY_ID, and only one DIRECTORY_ID of them is active (for the uppercase userid). Therefore the JIRA Admin User listing function shows only the one with uppercase, I assume.

    Hope this helps somehow.

  7. Andriy Zhdanov

    Uppercase usernames in worklogs is the problem for plugin since 2.3.13. Plugin assumes JIRA uses lowercase usernames internally. And I can not change it easily, it will break for others.

    There is a way to ensure lowercase usernames with crowd: https://confluence.atlassian.com/display/CROWD/Enforcing+Lower-Case+Usernames+and+Groups+for+an+Application

    But you said previously, you don't use crowd? And it does not seem possible to enforce lowercase with JIRA itself.

  8. Former user Account Deleted

    Yes, we are directly syncing the LDAP into JIRA.

    I do not see how this internally works, but in the CWD_USER table there is a LOWER_USER_NAME attribute, which contains lowercase usernames. Still, worklog contains uppercase.

    I cannot see at the moment why this lowercase username is an issue, why it has to be forced.

    As I can see JIRA itself behaves case-insensitively, as far as user picker and other JIRA search tools work (at leas what I can see).

  9. Andriy Zhdanov

    This 'case-insensitively' is a problem. This is achieved by lowercasing usernames. Plugin does this. But for some reason in your case in worklog table, usernames are not lower cased.

  10. Andriy Zhdanov

    I'm trying to take care of it, would you give a try upcoming 2.3.16 version from downloads? https://bitbucket.org/azhdanov/jiratimesheet/downloads/jira-timesheet-plugin-2.3.16.jar

    You need to add the following property to your jira/home/jira-config.properties and restart jira:

    jira.timesheet.plugin.preserveWorklogAuthorCase=true

    Please let me know if it works, because I really have some doubts.

    Also note, it will not pickup records that have lowercase worklog author in db. So the fix might be bad idea.

    Thank you.

  11. Former user Account Deleted

    Hmmm, interesting. Hopefully Atlassian will resolve this issue in Jira6 or I don't know. We will try 2.3.16 with the property entry, I'm just thinking how we will be able to fall back, after Atlassian solves this. Anyway, I'll get back to you later on.

  12. Andriy Zhdanov

    JIRA6 introduces userkey, so that username can be renamed: https://developer.atlassian.com/display/JIRADEV/Renamable+Users+in+JIRA+6.0 - Existing users will get allocated a key that is equal to the lowercase of the username.

    If this is used for worklogs, and if they are updated upon upgrade, then it would be fixed. Then you remove preserveWorklogAuthorCase property - plugin will use lowercase username, and if this is a problem I will update it to use userkey then.

    So this is long plan, but give the property a try first, please ,and make sure you don't care about "old" worklogs with lowercased author.

    Thank you.

  13. Former user Account Deleted

    Andriy, it is unfortunatelly not working.

    Version installed: 2.3.16 Jira config property updated as requested, Jira restarted.

    1. This gives back worklog entries for 3 users (user filter empty)

    https://....../secure/ConfigureReport.jspa?startDate=2013.04.08&endDate=2013.04.21&targetUser=&targetGroup=&priority=&projectid=10300&filterid=&projectRoleId=&weekends=true&showUsers=true&sumSubTasks=true&groupByField=&moreFields=&selectedProjectId=10803&reportKey=jira-timesheet-plugin%3Areport&Next=Next

    1. This gives back nothing (use filter filled in with on one the usernames listed in 1)

    https://..../secure/ConfigureReport.jspa?startDate=2013.04.08&endDate=2013.04.21&targetUser=U50563&targetGroup=&priority=&projectid=10300&filterid=&projectRoleId=&weekends=true&showUsers=true&sumSubTasks=true&groupByField=&moreFields=&selectedProjectId=10803&reportKey=jira-timesheet-plugin%3Areport&Next=Next

    1. I also tried to change manually the username to lowercase in the query string, just in case... but also empty result set.
  14. Andriy Zhdanov

    Hm, that's unfortunate. I've been going to write, that I've successfully verified it using crowd. I.e. I reproduced the problem with mixed-case username in crowd, and then setting the property to true, have seen worklogs using plugin. Note, I've not been able to configure JIRA with LDAP though.

    And I should have asked earlier, what version of JIRA do you use?

  15. Former user Account Deleted

    Version 5.1.1 Build Number 772 Build Date Tue Jul 17 00:00:00 CEST 2012 Build Revision c73db67d5b7b5c0c6559cdfee76905e8ca1a63cb

    Hmm, I cannot see the difference, I mean with or without Crowd the WORKLOG table should contain the username as a foreign key.

    I will doublecheck tje jira property again!

  16. Andriy Zhdanov

    Note, just verified with JIRA 5.1.1 same successfully. Hope, you can figure out if anything wrong with property.

  17. Former user Account Deleted

    Sorry, it will be our fault. The property was inserted into a wring place, I checked with our support team, we will restart Jira in the evening. I'm sure it will work tomorrow, but we will see. Sorry for the inconvenience.

  18. Andriy Zhdanov

    No problem, hope it will work for you, and discarding old worklogs will not be a big deal too. Note, there is GA 2.3.16 as well, so you may want better use official build from marketplace.

  19. Former user Account Deleted

    Ok, I'll try to update. Is there a way to update from marketplace, since we have got 2.3.16, so it does not allow an update from the plugin manager...

  20. Артур Папикян

    Andriy, good day! We had also faced this problem. Old, mixed-case user_name worklog entries of change_group table are ignored by plugin

    On the last week we has moved from version 4.3.4 to 5.2.4.1 User Directory was and is synchronized with the MSAD. What I noticed - in version 4.3.4 'cwd_users' table contain names (user_name column) one-to-one as they stored in AD, but in version 5.2, the same table and column has names in lower case only.

    I'm thinking about updating whole change_group table by setting value of author column to lowercase. What do you think is it bad idea?

    Anyway Atlassian has chaned rules, so why it should bother me :-)

    p.s.plugins versions tested from 2.3.13 to 2.3.16

  21. Former user Account Deleted

    Andriy, I tested the new version with the the property entry, it's working now, thank you very much!!

  22. Andriy Zhdanov

    @kkhu great, thank you for confirmation!

    @figarick I think it's good idea to make all old records usernames lower case, but you may want to do it using backup, changing case in xml for relevant users, but for 'worklogs' table, author column, I don't know what change_group table is.

  23. Log in to comment