Forums

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

Automation to identificate deviated issues

Jose Antonio Quesada February 9, 2023

Does someone know how to create an automation to identify the issues that are deviated?

Thanks in advance,

 

Jose

3 answers

1 accepted

1 vote
Answer accepted
Kian Stack Mumo Systems
Community Champion
February 9, 2023

@Jose Antonio Quesada

 

Try to run the JQL "workratio > 1". This should return any ticket where the timeSpent is greater than the original estimate.

 

Thanks,

Kian

Jose Antonio Quesada February 10, 2023

Hi @Kian Stack Mumo Systems 

Thanks for your proposal, but it doesn't work.

It always apply the label.

When time logged is greater than original estimate (it's OK)

automation5.PNG

When time logged is equal to original estimated (it's KO)

automation4.PNG

When time logged is smaller than original estimated (it's KO)

automation3.PNG

This is the rule configuration:

rule.PNG

Thanks,

Jose

Kian Stack Mumo Systems
Community Champion
February 10, 2023

@Jose Antonio Quesada

Thanks for highlighting that! It looks like in Jira Cloud, the workRatio field is actually on a scale of 0-100 rather than 0-1. Try doing workratio > 100 instead of workratio > 1!

Jose Antonio Quesada February 13, 2023

Hi @Kian Stack Mumo Systems 

It works if deviation value is greater than 1 hour. With a deviation of 5 minutes it doesn't work. 

But it's ok for me.

Thanks!!

Jose

1 vote
Kelly Arrey
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 9, 2023

Here's an example rule:

2023-02-09_09h58_38.png

 

And here's the output:

 

2023-02-09_09h58_59.png

Kian Stack Mumo Systems
Community Champion
February 9, 2023

That's a good solution as well! One benefit of this is that you could take other actions as well. For example alerting the assignee that the issue has now exceeded allotted time!

Like Kelly Arrey likes this
Jose Antonio Quesada February 10, 2023

Thank you very much! I've tested it but I can't get it to work.

automation1.png

Jira says the issues does not match the conditions, but the issue is deviated:

automation2.PNG

The support documentation (https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/) shows all the available fields, and I can't find the field {{issue.timeoriginalestimate}}

Maybe here is the problem?

Thanks in advance.

BR

Jose

Christoph Päper
Contributor
November 15, 2023

That list of smart values is not exhaustive. Check out the description in https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/ to find more.

The fields used for the smart values `{{issue.timespent}}` and `{{issue.timetracking.timeSpentSeconds}}` may have different access permissions, but they should both hold the same numeric value (in seconds) as `{{#issue.worklog.worklogs.timeSpentSeconds.sum}}` would yield (which may have other access permissions). If you don’t have sub-tasks or don’t track time therein, `{{issue.aggregatetimespent}}` will also be the same.

The long form would be `{{issue.fields.timespent}}`, by the way, but `fields.` can always be omitted and `issue.` is implied and thus optional much of the time, so `{{timespent}}` will work as well. Smart values also support reference by (non-translated) label, so `{{Time Spent}}`, `{{Remaining Estimate}}` and `{{Original Estimate}}` should work as well, but `{{remainingestimate}}` and `{{originalestimate}}` will fail, because they are actually called `{{timeestimate}}` and `{{timeoriginalestimate}}`, respectively (also available with `aggregate` in front).

The `issue.fields.timetracking` field holds the time already spent, the original and the remaining estimate and each value as a number in seconds and as a formatted string with units; it doesn’t keep information about sub-tasks:

"timetracking": {
"originalEstimate": "30m",
"remainingEstimate": "0m",
  "timeSpent": "1h 30m",
"originalEstimateSeconds": 1800,
"remainingEstimateSeconds": 0,
"timeSpentSeconds": 5400
},

Likewise, each work log entry also holds the time registered in two fields, textual `timeSpent` and numeric `timeSpentSeconds`. Always make sure you use the latter for calculations. Depending on context, `{{timespent}}` could refer to either of  `{{issue.timespent}}`, `{{timetracking.timespent}}` or even `{{worklogs.timespent}}`.

You might find the same duration values in another field, `{{progress}}` (and `{{aggregrateprogress}}`):

"progress": {
"progress": 5400, // = timespent
"total": 5400, // = max(timespent, timeoriginalestimate) or timespent + timeestimate?
"percent": 100 // = round(progress / total * 100)
},

There is a pre-calculated field `{{workratio}}` = `{{timespent.divide(timeoriginalestimate).multiply(100)}}`, but  no `{{aggregateworkratio}}` that would consider sub-tasks. Unlike `{{progress.percent}}`, it goes beyond 100.

0 votes
Vedant Kulkarni_Trundl
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 9, 2023

@Jose Antonio Quesada are you referring to deleted issues?

Jose Antonio Quesada February 9, 2023

No, to all the issues.

For example, I've an issue with 2 days (16 hours) of Original Estimation, but it has 20 hours logged.

This sample is a deviated issue, and I want to mark it.

Vedant Kulkarni_Trundl
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 9, 2023

@Jose Antonio Quesada

  1. you can configure automation
  2. apply conditions like thismark_deviation1.JPG
  3. mark as a comment or add a label from the automation rule

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events