I would like to write a JQL to retrieve the time spent on a specific sub-task. Below is my query. Sadly, what is being returned is the aggregate value of time spent and not the individual value as shown in the picture below.
This is my query below. Unfortunately, the result is showing an aggregated value. For e.g., it is displaying 6 hours instead of 3 hours (see "Results" picture below).
Results
Hi Fran, Thanks for responding. Can you elaborate on how to use the REST API
https://{your_url}/rest/api/latest/issue/{your_issuekey}/worklog
What is "your_url" here and how do I use it? Is ScriptRunner free to use? I am afraid that my company won't pay to buy add-ins.
your url is your jira url (something like 'xxxx.jira.com') you only have to make a GET request to that url and you'll receive a JSON with worklog data, the structure is like this
{
"startAt": 0,
"maxResults": 1,
"total": 1,
"worklogs": [
{
"self": "http://www.example.com/jira/rest/api/2/issue/10010/worklog/10000",
"author": {
"self": "http://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"displayName": "Fred F. User",
"active": false
},
"updateAuthor": {
"self": "http://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"displayName": "Fred F. User",
"active": false
},
"comment": "I did some work here.",
"visibility": {
"type": "group",
"value": "jira-developers"
},
"started": "2013-08-23T16:57:35.985+0200",
"timeSpent": "3h 20m",
"timeSpentSeconds": 12000,
"id": "100028"
}
]
}
You have more info here: https://docs.atlassian.com/DAC/rest/jira/6.1.html#d2e1552
Hope this helps you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JQL retrieves issues, and the field Time Spent for an issue is the total time spent.
On the DB you there is a worklog table, and via API you can also access every log
https://{your_url}/rest/api/latest/issue/{your_issuekey}/worklog
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have scriptrunner instaled, you also can access the issues that were logged by a certain user or in a certain date. (https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_worklogs)
issueFunction in workLogged(on "2015/07/28" by admin)
But you get the issue, with its Time Spent showing the total
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.