Forums

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

Automation Rule

Harshad Prajapati September 26, 2024

 

Below is givng erorr  , how to check check if condition Value > 0 

{{#if(issue.timetracking.originalEstimateSeconds|0 > 0)}}

{{#=}} ( ( {{issue.timetracking.originalEstimateSeconds}} - {{issue.timetracking.remainingEstimateSeconds}} ) / {{issue.timetracking.originalEstimateSeconds}} ) * 100 {{/}}

{{else}}

0

{{/}}

 

How to check  if issue.timetracking.originalEstimateSeconds > 0 in IF condition

 

issue.timetracking.originalEstimateSeconds|0 > 0

 

 

 

3 answers

2 accepted

0 votes
Answer accepted
Bill Sheboy
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.
September 26, 2024

Hi @Harshad Prajapati -- Welcome to the Atlassian Community!

The condition syntax with else handling looks like this, without the leading pound sign:

{{if(some condition, "True value", "False Value")}}

And so that cannot use the nested, long format math expression inside of it.

To do this with an inline math expression, you will need to multiply by 100 before the division.  Otherwise the non-integer value will always collapse to zero (because the first value originalEstimateSeconds is an integer).

For example:

{{if(issue.timetracking.originalEstimateSeconds.gt(0),issue.timetracking.originalEstimateSeconds.minus(issue.timetracking.remainingEstimateSeconds).multiply(100).divide(issue.timetracking.originalEstimateSeconds),0)}}

 

Kind regards,
Bill

0 votes
Answer accepted
Max - SwiftSprint dev
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.
September 26, 2024

Hi @Harshad Prajapati

try to use gt(..) function as described in this article Jira smart values - conditional logic | Automation for Jira Cloud and Data Center | Atlassian Documentation.

 

issue.timetracking.originalEstimateSeconds.gt(0)
Harshad Prajapati September 26, 2024

Thanks @Max - SwiftSprint dev , I have tried this before with  else if it is giving error.

 this is working fine

{{#if(issue.timetracking.originalEstimateSeconds.gt(0))}}
{{#=}}
( ( {{issue.timetracking.originalEstimateSeconds}} - {{issue.timetracking.remainingEstimateSeconds}} ) / {{issue.timetracking.originalEstimateSeconds}} ) * 100
{{/}}
{{/}}

I have setup this on "field value change" of time tracking and Log work but it is not triggerd when we chnaged the value log hours.


Actually It is not showing "Time spent"  or "Orginal estimated" in drown down list of "field value change" Can you pleasesuggest for this

Max - SwiftSprint dev
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.
September 26, 2024

@Harshad Prajapati ,

if you try to use Work logged trigger? 

it might require changing smart values to {{worklog.timeSpentSeconds}}, but try with both.

Harshad Prajapati September 26, 2024

@Max - SwiftSprint dev 
 

Thank Max I have used Work Logged triggered and it is working.

Like Max - SwiftSprint dev likes this
0 votes
Harshad Prajapati September 30, 2024

 

Hi,

I have setup "Issue Transitioned" from  "Development review" status to "Reopen" Status and trying to set some value when Reopen status is trigged in Automation Rule .

 

But is giving following Error , Can you please help me on this

"TRANSITION ISSUE
Destination status could not be resolved. If using a smart-value ensure this resolves to a numeric status ID or untranslated name for issues (with current status):
CI-4121 (Reopen - 10056)"

Bill Sheboy
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.
September 30, 2024

Hi @Harshad Prajapati -- Welcome to the Atlassian Community!

As you are asking a new question; I recommend you create a new, separate question to help focus the conversation, and...

For automation questions, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Kind regards,
Bill

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