Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Custom formula to apply based on history of a field

Erfan Alvand June 12, 2024

On our JDB, We have a field as Delivery Sprint and now we want to count how many times it's postponed, So we want to have a counter on it to add +1 to a field called "Pushed Sprint"

Now I added a formula to +1, But I don't want to add it when it was blank and we are not checking the allocated value.

Means after this value changes, I need to check if it was blank, do not add +1

 

Screen Shot 2024-06-12 at 1.09.03 PM.png

1 answer

0 votes
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.
June 13, 2024

Hi @Erfan Alvand 

Because your rule trigger is when the value changes, you may use the {{changelog}} smart value:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--

With that, you could check if the original value was non-blank, indicating that the value changed rather than was set for the first time.  To do that, please add a smart value condition after the trigger and before incrementing your field.

Kind regards,
Bill

Erfan Alvand June 14, 2024

Hi @Bill Sheboy 

Thanks for your answer,

I added it but still it's adding +1, Can you guide me on what I'm doing wrongly here, please?

Screen Shot 2024-06-14 at 3.17.22 PM.png

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.
June 14, 2024

First, your trigger is on the "Release Sprint" field and so that is the only one available with the changelog within the rule.  The "Pushed Sprints" field did not change.

 

Next, please confirm you have the correct smart value for your field in the condition...

Smart values are name, spacing, and case sensitive, and they may not exactly match the field's display name on the Jira pages.  When the incorrect smart value is used, that evaluates to null and often fails to work as expected.

To find the correct smart value (or custom field id) for your field, please use this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Erfan Alvand June 19, 2024

Thanks for reply @Bill Sheboy 

I applied changes but still it's not working and not considering which it was blank or not! Seems it can not understand the field was blank or not...

Screen Shot 2024-06-19 at 11.05.02 AM.png

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.
June 19, 2024

Have you confirmed that is the correct smart value for the field, Release Sprint?  If not, please do so before proceeding or the values will always be null.

 

Once you have confirmed the smart value, please remove issue from the changelog value.  For example:

{{#changelog.releasesprint}}{{fromString}}{{/}}

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events