JIRA: Generating per-user time report?

前端 未结 6 2390
一生所求
一生所求 2021-02-12 18:06

Sorry if SO is not the best place, but I have time-tracking enabled in JIRA and want to be able to generate a time-report for each user over a given date range. The only time-tr

相关标签:
6条回答
  • 2021-02-12 18:12

    You might want to check out Tempo Plugin for JIRA timetracking. It offers timesheets, reports and gadgets on user, team, project, and customer levels.

    0 讨论(0)
  • 2021-02-12 18:13

    You can easily do it with Everhour add-on for JIRA. It allows receiving a comprehensive report for each user over a given date range. And you are absolutely free to build any other layout of your reports and add as many data columns as you need.

    Jira Sample Report - Everhour

    0 讨论(0)
  • 2021-02-12 18:13

    If you're on Windows you can run the following powershell script to extract the data to CSV file.

    ## Instructions ##

    1. Open Powershell ISE (It's installed to all windows 7 and later PCs)

    2. Create a new PowerShell script (ctrl+n)

    3. Paste the text from the following code block into the new file


    ##################################################################
    # Variables
    ##################################################################
    
    $username = "myname@asdf.com"
    $password = Read-host "What's your Jira password?" -AsSecureString 
    #$password = ""
    
    $jiraDomain = "asdf.atlassian.net"
    $projectKey = "ABC"
    $startDate = [datetime]::ParseExact('2017-05-08', 'yyyy-MM-dd', $null)
    $endDate = Get-Date
    #Get-Date = today
    
    $csvFileName =c:\temp\Worklog.csv
    
    ##################################################################
    # Functions
    ##################################################################
    
    function get-jiraData {
        param( [string]$restRequest)
        Invoke-RestMethod -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Uri $restRequest
    }
    
    function get-issues {
        param( [string]$projectName)
    
        $uri = "https://${jiraDomain}/rest/api/2/search?jql=project=${projectName}"
        $issuesPage = get-jiraData -RestRequest $uri
    
        #write first batch of issues
        $issuesPage.issues
        #do next batches
        do  {
            $startAt = $issuesPage.maxResults + 1
            $uri = "https://${jiraDomain}/rest/api/2/search?jql=project=${projectName}&startAt=$startAt"
            $issuesPage = get-jiraData -RestRequest $uri
    
            #write next batch of issues
            $issuesPage.issues
        } while (($issuesPage.startAt + $issuesPage.maxResults) -lt $issuesPage.total)
    }
    
    filter convert-worklog {
            $worklog = New-Object System.Object
            $worklog | Add-Member –type NoteProperty –Name Person –Value $_.author.name
            $worklog | Add-Member –type NoteProperty –Name IssueKey –Value $key
            $startDate = [datetime]::ParseExact($_.started.Substring(0,16), 'yyyy-MM-ddTHH:mm', $null)
            $worklog | Add-Member –type NoteProperty –Name DateLogged –Value $startDate
            $TimeMinutes = $_.timeSpentSeconds / 60
            $worklog | Add-Member –type NoteProperty –Name TimeSpent –Value $TimeMinutes
            $worklog | Add-Member –type NoteProperty –Name Comment –Value $_.comment
    
            $worklog
    }
    
    filter extract-worklogs {
        #$key = "WL-22"
        $key = $_.key
    
        $uri = "https://${jiraDomain}/rest/api/2/issue/${key}/worklog"
    
        $worklogsPage = get-jiraData -RestRequest $uri
    
        #write first batch of worklogs
        $worklogsPage.worklogs | convert-worklog
    
        #Check for another batch of worklogs
        do  {
            $startAt = $worklogsPage.maxResults + 1
            $uri = "https://${jiraDomain}/rest/api/2/issue/${key}/worklog?startAt=$startAt"
            $worklogsPage = get-jiraData -RestRequest $uri
    
            #write next batch of worklogs
            $worklogsPage.worklogs | convert-worklog
    
        } while (($worklogsPage.startAt + $worklogsPage.maxResults) -lt $worklogsPage.total)
    }
    
    ##################################################################
    # Execution
    ##################################################################
    
    
    #Setup Authentication variable
    $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))
    
    #This grabs all the worklogs for a project, then filters them by 
    $WorkLogs = get-issues -projectName $projectKey | extract-worklogs | ?{ $_.DateLogged -gt $startDate -and $_.DateLogged -lt $endDate } | sort DateLogged 
    
    $WorkLogs | export-csv $csvFileName -NoTypeInformation
    

    1. Modify the variables at the start of the file

    2. Save as a powershell script somewhere on your PC

    3. Run the script by double clicking it

    0 讨论(0)
  • 2021-02-12 18:33

    how about this one:

    https://plugins.atlassian.com/plugin/details/294

    0 讨论(0)
  • 2021-02-12 18:34

    If you don't want to pay a lot of money for a simple action like getting a summary of time per user.

    I found this flow useful:

    1. Create a filter that you like to measure (I measure time only by sub tasks)
    2. Export it to excel
    3. Copy and paste it into a google docs spreadsheet
    4. In google docs you have an option to create a Pivot Table, so just create one that the rows are the assignees and the values are the time

    You can also create a calculated column to get the time in hours (just divide it by 3600)

    Hope it helps

    0 讨论(0)
  • 2021-02-12 18:38

    Using the Better Excel Plugin you can take advantage of all reporting features in Microsoft Excel.

    This plugin exports any sort of JIRA data (including issue fields and worklogs) to custom Excel templates. The templates can use filtering to the date range, and can display your report in an Excel pivot table. If you need further dimensions (like additional grouping by project, by component, by week, by month, etc.), these are super simple to add. You can also visualize the output in a pivot chart.

    Tip: there is a default template included in the plugin, called worklog-report.xlsx, which can be used as is, or as starting point for further customization. It looks like this (there is a time-by-project pivot chart in the first worksheet, but I don't have a screenshot about that):

    enter image description here

    After the template is created, you can merge that with the most current JIRA data any time by a single click, or even generate it and email it to you automatically.

    Disclaimer: I'm a developer working on this paid add-on.

    0 讨论(0)
提交回复
热议问题