Forums

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

Filters for Automation rules

Ankit Nangia August 21, 2019

Can we add filter to the automation rules? Through automation rules i am creating automated tickets which are sent on daily basis to assignee. Now i want to use a filter determining on each day which assignee is working for how many hours and on what tickets. 

For example i need to see on monday , assignee =xyz has worked for how many hrs on on what all tickets. Please let me know if there is any filter JQL query .

1 answer

1 accepted

0 votes
Answer accepted
Krister Broman [Advania]
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.
August 22, 2019

Yes, you can use filter in JQL query and use them in automation rules - i.e. filter = FILTERABC

BUT

No you cannot use a filter to calculate a sum total, the filter is a dynamic list of matching issues and has no built in calculation. Some plugins allow for doing calculations in a filter, but I do not think that you can use those results in automation as they generally present their result in a gadget. Other plugins calculate fields but would not calculate based on a filter. 

If you are going to do this it probably involves a lot of custom scripting to get right. 

Ankit Nangia August 22, 2019

@Krister Broman [Advania] Can you provide some more detail as in how i can use filter in JQL query and use them in automation rules?...what steps need to be follow to have a filter according to day.

For eg I need to know on Monday who all have worked and on which tickets.

Krister Broman [Advania]
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.
August 22, 2019

Again finding out which persons work on day X would be a summation or rather a grouping of persons and that is not what Filters are for.

The filter will easily find the issues that was done on that day by using the StartOfWeek Function i.e.

Find issues updated on tuesday: updated >= startOfWeek(1d) AND updated <= startOfWeek(2d)

If you create this in FilterABC then this can be reference through the JQL function filter = FilterABC

StartofWeek is a specific time, so for the update field which is date/time you have to have a start and stop while for a pure date field (like due date) you can make due with just a start date. 

But if Person A has worked with 5 issues, you are going to get 5 results for the filter.

Thomas Magny-Garcia
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.
August 22, 2019

Hi @Krister Broman [Advania] ,

I think it is possible to made some calculation in JQL query using issueFunction method, don't you?

 

For example, to see the total estimate for all issues in the LOAD project run this jql:

project = LOAD and issueFunction in aggregateExpression("Total Estimate for all Issues", "originalEstimate.sum()")

 

However, I don't think you can use the work log (I assume @Ankit Nangia want to use it to get the time spent by xyz on the subjects ) with this way...

Hope it helps !

Krister Broman [Advania]
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.
August 22, 2019

aggregateExpression is to my knowledge a part of scriptrunner and i sort of assumed the solution should work without plugins. There is a second problem in that the aggregateExpression function posts the result in an information section in Jira and not as an integrated part of the result which i think (but am not sure) is not possible to use in an automation scenario. 

You can use it with time spent: 

issueFunction in aggregateExpression("Time spent", "timespent.sum()") 

From my reading I think Ankit wants to group users and get the data, then automatically assign a new case to the person with the lowest amount of time or something like that.

I guess if the users are always the same you could have one filter for each user and day in week but sort of a heavy solution that still do not solve which user for a specific day that has the least amount of time. 

Like # people like this
Ankit Nangia August 22, 2019

@Krister Broman [Advania] you assumed it right, this is what an idea is...to check which user is occupied on which day and allocate the work accordingly. Basically a help to resource management.

But i am still not clear what to do, pls help if you have any kind of solution

Krister Broman [Advania]
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.
August 22, 2019

The only things i can think of is

First possible solution, combining the plugins "Automation for Jira" which would boost your abilities to add rules and Scriptrunner which would add more JQL possibilities, this might possibly be enough for a working solution, unfortunatly I dont have access to Automation for Jira so cant test any solutions. 

Second alternative could be escalation/dispatching plugins such as OpsGenie, PagerDuty, xMatters, I have not worked with any one them so cant really say but it sounds like that could be something that could be fixed

Third alternative is starting to do some scripting and build a custom plugin/scriptrunner rule yourself to create the functionality. 

Unfortunately i see no great out of the box solution without plugins for what you are looking for.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events