JQL Filter for time logged after closed

Natalia M.
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 1, 2021

Hi, I would like to write an advanced search filter for searching of issues, where time was logged after it was closed. Does anyone can help me?

3 answers

1 vote
Iago Docando
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.
February 2, 2021

I think you can do it with groovy or script runner if you compare the values of the latest worklogDate and resolutionDate (if by closed you mean resolved, if you mean a particular status then you need the date of the transition). To achieve this there's a number of different things you need to consider.

Comparing two date fields.  This will be mandatory at some point or another. Go ahead and read this, and make some adjustment if needed. You could very well not need to change anything at all. https://community.atlassian.com/t5/Jira-questions/ScriptRunner-find-number-of-days-between-two-custom-date-fields/qaq-p/596551#M197534%C2%A0

Getting transition dates, or any date for that matter. Just configure an automation so every time the transition is executed updates the value of a custom date field with the current date (or date time). Also you could store the date of any action you like... let's say every time time is logged to the issue you store the current date in a date field called "latest worklogDate".

Defining the JQL you're going to use. A convenient way (for me) would be a simple JQL. Something like customField_xxx=value. A flag, basically. You'll need then to create a custom field that takes the defined value if the desired condition is met, or use another operator (<, >, ...). Call it LateWorklog or something.

Creating a customField that acts as a flag. There may be lots of ways to do this. I personally use groovy custom field scripts. Using the code to compare two date fields you could create a custom field thar returns the difference in days or whatever between your closed status transition date and your latest worklog date.

 

With all this done, if your custom groovy script field compates your "latest worklogdate" and your "closed date" you could retrieve your desired list of issues searching  for "LateWorklog > 0".

I hope it helps 

1 vote
Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2021

Hi @Natalia M. 

Looking at JQL functions from Scriptrunner https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_worklogged and JQLtricks https://www.j-tricks.com/jqlt-worklog-functions.html i do not think it is possible by status.

I does support date range though.

Have you looked at advanced reporting tools like eazybi or tableau?

0 votes
Christophe Noualhat June 15, 2021

I used automation to trigger an email if time is logged when the status is closed, could not find an JQL filter that could do it.

Trigger : When work logged

IF : status is ... (closed statuses)

Then: send email

Suggest an answer

Log in or Sign up to answer