Threshold based trigger

Faizan Iftikhar October 8, 2021

Dear Members,

Please help to find a solution.

Need to make a trigger when total time logged hits a certain threshold, rule trigger and send mail.

Thanks in Advance

 

BR,

M Faizan

4 answers

2 accepted

3 votes
Answer accepted
Vishal Biyani
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.
October 8, 2021

@Faizan Iftikhar 

You can write an automation rule by checking if Value changes for Time tracking. After that you can put the numeric condition to compare if total time is > then your threshold, then use New Action to trigger Email action.

I haven't tried this... but this approach should work.

automation.PNG

Faizan Iftikhar October 8, 2021

Hi @Vishal Biyani  what condition need to put in JQL for total time spent i.e. if i am putting time spent it is fetching project ticket details that is above threshold , please comment 

12.jpg

Vishal Biyani
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.
October 8, 2021

Let me try to elaborate a bit more. There is No need for JQL, if you are interested in Time tracking changes.

When the rule checks for "Value Changes for Time Tracking" it will get fired when time is logged against any issue in project. You can include the event. I had selected "Create Issue" and "Edit Issue"

see the right side of the screenshot.

After that you can use smart values like {{issue.aggregatetimeoriginalestimate}} to check for instance i can say

if {{issue.aggregatetimeoriginalestimate}} > 40*3600 Then trigger email

Hope this helps.

[Note: 40*3600 means 40 hours since in my instance time is set to minutes granularity]

Faizan Iftikhar October 8, 2021

Thanks @Vishal Biyani  for extended help.

I have added one extra condition as it works for overall project hours so restricted on a particular category PFB snapshot.

If you can validate that would Great help !!

 

13.jpg

 

Thanks in Advance!!

Vishal Biyani
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.
October 9, 2021

Looks good. Just make sure that default unit of time tracking is minutes. Jira admin can check this

settings -> Issues -> Issue Features -> Time Tracking

if this is set to hours then change the division from 3600 to 60.

Like Faizan Iftikhar likes this
Faizan Iftikhar October 10, 2021

Hi @Vishal Biyani  Appreciate your extended help and prompt responses to akke it happen.. 

 

Much Appreciate it!!

Faizan Iftikhar October 27, 2021

Hi @Vishal Biyani 

hope you doing good, can you please help or Any one please.

Trigger was working fine before but after minor tweaks it stop working even after revert with previous configurations, here is some details:

- Sending email every time when condition meets but now not working and giving error mentioned below

 

123.jpg

1 vote
Answer accepted
Alexey
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.
October 8, 2021

I have a rule to warn if overbudget occurred, you can play with the work ratio to meet the needed threshold. And the rule runs every time anyone is logging time or like mentioned above to use 'scheduled' trigger with CRON expression

Project automation - Jira — Yandex Browser 2021-10.png

Faizan Iftikhar October 8, 2021

Hi @Alexey  would you please clarify what work ratio? Is 100 representing hours restriction?

Alexey
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.
October 8, 2021

@Faizan Iftikhar yes, it's % of the logged time, its original estimate vs remaining/logged

Like Faizan Iftikhar likes this
0 votes
Andrii Maliuta
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.
October 8, 2021

Hello @Faizan Iftikhar ,

Could you please clarify where the time is being logged/set? Do you need to have some custom menu/UI to set the time for sending email or it is just inside some custom code (add-on) that is required? Is it JIRA cloud or server ?

THank you

Faizan Iftikhar October 8, 2021

Hi

Thankyou for reply

- time logged in JIRA cloud

- every ticket belongs to bucket i.e. category, which have limit of hours i.e. 50 or 60 hrs per month

- if bucket hours is reach limit of 30hours , trigger start work and send mail notification

Thanks

0 votes
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 8, 2021

You could use the Scheduled trigger and run it every 5min for example.

In the JQL field you can filter for all issue having more than X hours logged. Example for more than 4 hours: timespent > 4h

And as an action you can use the Send Email action

2021-10-08 15_40_27-Automation rules - Jira.png

Faizan Iftikhar October 8, 2021

Hi

Thankyou for your reply

Facing issue as in return any ticket that has above 30 hours spent is reporting back. need to know the query name of time logging means work log created so that in return got a proper figure.

Thanks

Suggest an answer

Log in or Sign up to answer