Timesheet report with filter not working

Issue #787 resolved
Milijan Gacanovic created an issue

2016-02-22 11_28_50-Time Reports - JIRA.png

2016-02-22 11_29_38-Time Reports - JIRA.png

And yes, filter is working fine in jira search and is listing the ticket from first screen shoot

Comments (30)

  1. Andriy Zhdanov

    Hi Milijan,

    And is there any work logged by you for the selected period for any issue from the Excluding WFH and Standby filter?

    Thank you.

  2. Milijan Gacanovic reporter

    Hi Andriy,

    This is an exclusion filter, which excludes some work logs based on custom field value. When I apply this filter in Jira search I see all worklogs (from multiple projects) in the selected period (also including entry from first screen shoot, from internal project). My expectation is that Timesheet report will show the same results as jira search

  3. Milijan Gacanovic reporter

    My bad, obviously it is not returning worklogs but all issues where worklogAuthor is me except issues which are excluded based on custom field value.

    This filter is working fine with "old" Time Sheet Report

  4. Milijan Gacanovic reporter

    As filter is filtering on custom field it wouldn't make much sense for try it out directly on your instance. Can you confirm that any kind of filtering is working (for example filter with only resolution = Unresolved") ?

  5. Milijan Gacanovic reporter

    I have reproduced the problem with a simple filter priority = 3 Filter is working fine in Jira search.

    Expectation is that this filter filters worklog items and only shows worklog for work done on priority 3 issues in selected period. This does not work and, although there are worklogs on priority 3 issues in the selected period time report returns 0 results.

  6. Andriy Zhdanov

    There must be something else. Is it only priority = 3 filter, or you have something else there?

  7. Andriy Zhdanov

    Have you noticed you have January 1 - January 10 time frame? Is there work logged in this time frame for those issues? Yes, please provide screen shots. I can't reproduce it.

  8. Milijan Gacanovic reporter

    Screenshot 1, work logs for selected period for project Internal, 2 work log entries to the same ticket with priority 3

    2016-02-23 15_17_37-Time Reports - JIRA.png

    Screenshot 2: priority = 3 filter executed through jira search, returning, among various tickets from various projects, the same ticket as on screen shoot 1 (On the 3rd page of results)

    2016-02-23 15_21_22-[Filter issue priority = 3] Issue Navigator - JIRA.png

    Screen shoot 3: Removing project filter and adding only priority = 3 filter, no results returned

    2016-02-23 15_18_15-Time Reports - JIRA.png

    **While reproducing I have noticed that when I disable "Sum SubTasks" checkbox everything is working as expected. When "Sum SubTasks" is enabled I am getting the results above.

    All in all, this looks like Sum SubTasks problem and not a filter problem.**

  9. Andriy Zhdanov

    Hm, and does Sum SubTasks make any difference if only 000 Internal filter is selected?

    From other hand, is the INTERNAL-3 issue somehow child of any other issue? You might have configured it in Add-on Configuration. See Configure link in the page header.

  10. Andriy Zhdanov

    Just would like to notice, how it works. It builds query basing on selected filters and projects, using or between all filters, and projects, and combining two sets with and. E.g. (project="000 Internal") and (filterid=1 or filterid=2), where 1 and 2 could stand for two Filters you've created.

  11. Milijan Gacanovic reporter

    Concerning Sub Tasks check box issue, when I select a project as a filter regardless of the Sub Tasks check box status correct work logs are displayed.

    Internal 3 issue is created directly in the project and is not a subtask of any other issue:

    2016-02-23 16_34_29-[INTERNAL-3] National holiday - JIRA.png

    I am not sure what you mean when you say that I might have configured child status via add-on configuration. Can you please provide more details on this.

  12. Andriy Zhdanov

    It is possible to use Links for child/parent also, see Configure link in the header of the Time Reports page.

  13. Andriy Zhdanov

    Thanks, and I've finally found a problem, sorry it took me so long, it reproduces in some case, and did not reproduce in other quite the same.

  14. Andriy Zhdanov

    Well, sorry again, looks like I was wrong. I don't see a problem.

    Could you please help to investigate it further? Could you open Browser Console, Network tab, click Refresh in the add-on page (in the bottom of options menu in the left pane), and see at least two requests:

    1) /jira/rest/api/2/search?fields=~&jql=filter%3D10000%20and%20project%3D%22TIME%22&startAt=0&_=1456246285963 in this case

    I'm interested in jql parameter in particular: e.g. jql=filter=10000 and project="TIME".

    2) /rest/api/2/search?fields=project,issuetype,summary,priority,status,issuelinks,timeoriginalestimate,timeestimate,timespent,worklog,customfield_10002&maxResults=1000&jql=worklogDate%3E%3D%222016-02-20%22%20and%20worklogDate%3C%3D%222016-02-28%22%20and%20worklogAuthor%3D%22admin%22&startAt=0&_=1456246285966

    I'm interested in jql parameter in particular: e.g. jql=worklogDate>="2016-02-20" and worklogDate<="2016-02-28" and worklogAuthor="admin" in this case.

    Then please try to take JQL from the first case, and execute in your Issue Navigator. Does it return expected issue?

    Note, you may use http://meyerweb.com/eric/tools/dencoder/ to decode JQL url parameter.

    Thank you.

  15. Milijan Gacanovic reporter

    With Sum Subtasks disabled (time report working) there is only one search call:

    xxx/rest/api/2/search?fields=project,issuetype,summary,priority,status,parent,issuelinks,timeoriginalestimate,timeestimate,timespent,worklog,customfield_10017&maxResults=1000&jql=filter%3D10705%20and%20worklogDate%3E%3D%222015-12-31%22%20and%20worklogDate%3C%3D%222016-01-11%22%20and%20worklogAuthor%3D%22Milijan.Gacanovic%22&startAt=0&_=1456307420907
    

    With Sum Subtasks enabled (time report not working), there are multiple search calls:

    xxx/rest/api/2/search?fields=~&jql=filter%3D10705&startAt=850&_=1456310607371
    xxx/rest/api/2/search?fields=~&jql=filter%3D10705&startAt=800&_=1456310607368
    xxx/rest/api/2/search?fields=~&jql=filter%3D10705&startAt=750&_=1456310607365
    .......
    xxx/rest/api/2/search?fields=~&jql=filter%3D10705&startAt=0&_=1456310606901
    xxx/rest/api/2/search?fields=project,issuetype,summary,priority,status,parent,issuelinks,timeoriginalestimate,timeestimate,timespent,worklog,customfield_10017&maxResults=1000&jql=worklogDate%3E%3D%222015-12-31%22%20and%20worklogDate%3C%3D%222016-01-11%22%20and%20worklogAuthor%3D%22Milijan.Gacanovic%22&startAt=0&_=1456310606906
    xxx/rest/api/2/search?fields=project,issuetype,summary,priority,status,parent,issuelinks,timeoriginalestimate,timeestimate,timespent,worklog,customfield_10017&maxResults=1000&jql=filter%3D10705%20and%20worklogDate%3E%3D%222015-12-31%22%20and%20worklogDate%3C%3D%222016-01-11%22%20and%20worklogAuthor%3D%22Milijan.Gacanovic%22&startAt=0&_=1456308047762
    

    I have tested all of them in search:

    • filter=10705 and worklogDate>="2015-12-31" and worklogDate<="2016-01-11" and worklogAuthor="Milijan.Gacanovic" - working as expected
    • filter=10705 - working as expected
    • worklogDate>="2015-12-31" and worklogDate<="2016-01-11" and worklogAuthor="Milijan.Gacanovic" - working as expected
    • filter=10705 and worklogDate>="2015-12-31" and worklogDate<="2016-01-11" and worklogAuthor="Milijan.Gacanovic" - working as expected
  16. Andriy Zhdanov

    Hi Milijan,

    Thank you. I can see one problem, requests in first set, in case of sum Subtasks enabled, does not have maxResults parameter, I've fixed it now.

    However, the real problem must be somewhat deeper.

    Apparently, the filter which is not working with SumSubtasks has about 1000 issues, and when add-on tried to fetch them in a batches of 50, one of them should have failed, but it is not properly diagnosed, so report has empty result instead of showing an error. However, I can't figure out.

    Please let me know if the report works now.

    Thank you.

  17. Milijan Gacanovic reporter

    Everything is now working as expected, correct results are shown with both Sum Subtasks enabled and disabled.

    Tnx Andriy

  18. Milijan Gacanovic reporter
    • changed status to open

    It seems that I have spoken too soon.

    The problem with filters based on custom fields still remains. Should I open new ticket for that one or can you continue investigation in this ticket (I will provide additional info once I know where)

    Tnx

  19. Andriy Zhdanov

    We can continue here.

    So can you see in the browser log any error or any of the requests like xxx/rest/api/2/search?fields=~ has failed?

    Thank you.

  20. Milijan Gacanovic reporter

    Using filter with exclusion based on custom filed:

    With Sum Subtasks disabled there are 3 tickets with work logs returned (correct) and one search call:

    xxx/rest/api/2/search?fields=project,issuetype,summary,priority,status,parent,issuelinks,timeoriginalestimate,timeestimate,timespent,worklog,customfield_10017&maxResults=1000&jql=filter%3D10401%20and%20worklogDate%3E%3D%222015-12-31%22%20and%20worklogDate%3C%3D%222016-01-11%22%20and%20worklogAuthor%3D%22Milijan.Gacanovic%22&startAt=0&_=1456320149770
    

    Parameters filter=10401 and worklogDate>="2015-12-31" and worklogDate<="2016-01-11" and worklogAuthor="Milijan.Gacanovic"

    With Sum Subtasks enabled there is 1 ticket with worklogs returned (incorrect), and multiple search calls:

    xxx/rest/api/2/search?fields=~&maxResults=1000&jql=filter%3D10401&startAt=0&_=1456320576308
    xxx/rest/api/2/search?fields=~&maxResults=1000&jql=filter%3D10401&startAt=1000&_=1456320576730
    xxx/rest/api/2/search?fields=project,issuetype,summary,priority,status,parent,issuelinks,timeoriginalestimate,timeestimate,timespent,worklog,customfield_10017&maxResults=1000&jql=worklogDate%3E%3D%222015-12-31%22%20and%20worklogDate%3C%3D%222016-01-11%22%20and%20worklogAuthor%3D%22Milijan.Gacanovic%22&startAt=0&_=1456320576311
    

    Parameters worklogDate>="2015-12-31" and worklogDate<="2016-01-11" and worklogAuthor="Milijan.Gacanovic"

    No console errors, all resources report 200 OK

  21. Andriy Zhdanov

    Hi Milijan,

    Should be fixed finally (stupid mistake that is usually the most hard to find).

    Thank you

  22. Log in to comment