Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract the data with the recentmost date

Anibrata Pal
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!
September 5, 2018

Hi all, I have a JIRA filter that extracts data from various dates. Now consider the situation where a field <NAME> has multiple records for various <DATE>(dates). I would like to extract all distinct <NAME> with latest <DATE>.

eg. 

NAME    field2     DATE     field4    field5
------      -------    -------   -------  -------
AAA       ******     18/01    ******    ******
AAA       ******     18/02    ******    ******
BBB        ******     17/07    ******    ******
BBB        ******     17/08    ******    ******
CCC        ******     16/02    ******    ******
AAA       ******     18/08    ******    ******

I would need the records :
AAA       ******     18/08    ******    ******
BBB        ******     17/08    ******    ******
CCC        ******     16/02    ******    ******

Need to know if there is any keyword filter that helps to this. 

1 answer

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2018

Hello Anibrata,

Unfortunately, JIRA JQL does not have the functionality to return only the issue which is the most recent of a determined date, however, you can use the command ORDER BY to group the results by users and order it by the date field.

E.g:

ORDER BY name ASC, date DESC


Also, I checked that this functionality can be implemented by using the plugin  Automation for JIRA, however, it will require a big amount of work depending on how many users do you have on your site. Anyway, here are the steps:

1 - Create a text custom field (In my rule, I configured the field with the name Workaround)

2 - Create a rule that will trigger everytime a user change the date field (In my rule, I configured the field with the name Due Date) AND the field name is a specific one
P.S: you will need to create an automation rule for each name you have on your site.

3 - Add a component to the rule that will add any value to the field Workaround for that specific issue

4 - Add a Branch rule that will clear the value of the field Workaround for all the other issues where the name is the same that the trigger issue.

Performing the steps above, you will be able to return only the issue which is the most recent of a determined date with this simple JQL query:

workaround = thevalueyouset

P.S: the rule might not work properly if the value of the date field be configured manually since the user can configure a date before the other issues edited, so I would recommend you to automatically configure the date field (by post function) with the last date.

Screen Shot 2018-09-06 at 12.06.54.png

Suggest an answer

Log in or Sign up to answer