Filtering Latest Subtasks

Choo Kai Min Bryan March 17, 2019
Our company have our partners listed in a parent issue. Each of their purchases are created with a subtask to track the items and the day of purchase. We are currently trying to find all active partners , and their last known purchase. Below is an example on our issue hierarchy.

Example

Parent Key 1.1
-Purchase Ticket 1.1, status = Completed
- Purchase Ticket 1.2, Status = Canceled

Parent Key 2
- Purchase Ticket 2.1, status = Canceled
- Purchase Ticket 2.2, status = Completed
- Purchase Ticket 2.3, status = Completed

We would like to find the last known order issues by with our partners. I hope there is a way to find latest completed Tickets. We have scriptrunner if it helps or if there are plugins that can help this would be very helpful! Thanks guys !

The result we hope to achieve is

-Purchase Ticket 2,3
-Purchase Ticket 1.1

2 answers

0 votes
Choo Kai Min Bryan March 19, 2019
Thanks for taking the time to answer my question Marc! To clarify , the last known issue would mean , the last known Purchase Order (Based from date) from the particular customer (Parent Key).

So example , Company X has 3 Purchase Orders with us (3 Subtasks). In the Subtasks would have the orders and the date of orders. Based on the parent issue , find the subtask that was last completed.

Example being , Company X has 2 Purchase Orders.
-Purchase Order 1.1 on 11/02/2019 , status = Completed
- Purchase Order 1.2 on 21/03/2019 , status = Completed.

We would want to filter the Purchase Order 1.2 as that was the last order from him as the Purchase Order 1.1 was roughly a month ago , we would want the most updated , latest order from the company.

Therefore we hope to filter this out for all our clients (Companies).

If Scriptrunner would help, could we request your assistance ? Because I'm not too adept in JQL. Thanks Marc !
Marc Minten _EVS_
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.
March 20, 2019

Hi,

Are you somewhat experienced with scriptrunner ? Then with the help of their documentation it should not be too hard to write a custom JQL-function script.

If you are not somewhat familiar with writing scriptrunner scripts , I think using scriptrunner for this might not be a good idea...

I can't write a script for you without knowing your environment (names of issue types, custom field names and types, …)

Choo Kai Min Bryan March 21, 2019

I read some of the documentation but i'm not too familiar with how I should write the scripts for scriptrunner but normal JQL filtering is what I'm stronger in. Could you help do a draft for the script. It would help change our workflow for our company !

0 votes
Marc Minten _EVS_
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.
March 18, 2019

It is not clear what your definition of "the last known" is, but I think this is not feasible with the standard Jira.

But as you have scriptrunner, I would create a scripted JQL function for this. The Adaptavist documentation is a quite good starter. I have built several myself :-)

Suggest an answer

Log in or Sign up to answer