Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get total workLog in Jira for an user on today's day?

ranveer5289 October 5, 2015

I wanted to get the total worklog of an user for present today.

For eg : I worked total of 6 hours today on various tasks, I can see this in JIRA Dashboard.

How, do I fetch this value(6 hours) using the JIRA Rest API or a JQL query.

Thanks,

Ranveer

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2015

SQL for JIRA is a new add-on available on the Marketplace which resolves it easily:

issue in sql("
    SELECT 
         DISTINCT I.KEY
    FROM 
         ISSUEWORKLOGS W
         	INNER JOIN 
		 ISSUES I ON W.ISSUEID = I.ID
    WHERE 
        I.JQL='updated >= startOfDay() AND   participants = <username>'
			AND
        W.AUTHOR='<username>'
")

How it works?

  1. It runs the JIRA JQL = 'updated >= startOfDay() AND participants = currentUser()' in order to get the potential issues that a user has work on.
  2. For each issue above its work log records are fectched from JIRA via API 
  3. For each record above, only the worklogs created by the <username> and taken in consideration.
  4. The built-in sql JQL function will transform the distinct issue keys in the format expected by the JQL engine,

If you want to display that information on a JIRA Dashborad you could use the complementary free SQL for JIRA Reports and Gadgets add-on to a visualization of the data embedded in a JIRA gadget.

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2015

I've updated it to make it more efficient according to the JQL provided by an Atlassian Support engineer and to transform the SQL results into a JQL function :)

TAGS
AUG Leaders

Atlassian Community Events