Hello everyone,
I’m trying to set up a JIRA automation rule to automatically update a custom field called V-Impact based on the value of another field, Time Saved. Here's the logic I'm aiming for:
I’ve tried using smart values in the JIRA automation if statements, but it keeps filling the V-Impact field with an empty value no matter the value in Time Saved.
Here’s the expression I tried:
{{#if(issue.Time Saved|0 <= 4)}} 1 {{/}}
{{#if(issue.Time Saved > 4 and issue.Time Saved <= 8)}} 2 {{/}}
{{#if(issue.Time Saved > 8 and issue.Time Saved <= 12)}} 3 {{/}} {
{#if(issue.Time Saved > 12 and issue.Time Saved <= 20)}} 5 {{/}}
{{#if(issue.Time Saved > 20 and issue.Time Saved <= 32)}} 8 {{/}}
{{#if(issue.Time Saved > 32 and issue.Time Saved <= 52)}} 13 {{/}}
{{#if(issue.Time Saved > 84)}} 21 {{/}}
I would appreciate any guidance on how to correctly implement this logic in JIRA automation, or if there is a better approach to achieve this.
Thank you in advance for your help!
Gregory
Hi @Gregory Welcome to the community!
Using the if/else structure is more efficient than stacking separate if blocks. You can achieve this with a single smart value expression using if/else like this
{{#if(issue.fields.Time Saved <= 4)}}1
{{else if(issue.fields.Time Saved > 4 and issue.fields.Time Saved <= 8)}}2
{{else if(issue.fields.Time Saved > 8 and issue.fields.Time Saved <= 12)}}3
{{else if(issue.fields.Time Saved > 12 and issue.fields.Time Saved <= 20)}}5
{{else if(issue.fields.Time Saved > 20 and issue.fields.Time Saved <= 32)}}8
{{else if(issue.fields.Time Saved > 32 and issue.fields.Time Saved <= 52)}}13
{{else if(issue.fields.Time Saved > 52 and issue.fields.Time Saved <= 84)}}13
{{else if(issue.fields.Time Saved > 84)}}21{{/}}
Hello Manoj,
Thanks for your reply.
I didn't mentioned it in the initial post by I also tried the if/else structure as you shared.
Same result, the rule is successfully executed though no value the field V-Impact is always updated with "none".
I'm thinking the value 1,2,3, 5, etc... in the smart value may be seen as "string" while the V-Impact is waiting a "number".
Gregory
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ensure that you're referencing the Time Saved custom field correctly. It’s best to verify the exact field name and ID (e.g., customfield_12345) by checking the field in Jira. This might look like:
issue.fields["customfield_12345"]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Manoj,
Sorry for the late reply.
I tried the solution of using the custom field name and ID, as well as some few other ways to format the "algorithm".
Unfortunately the result is always the same, it ends up with ""none" in the V-Impact field.
I think we will export the data via API to do the computation outside of JIRA.
Thanks anyway.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.