Forums

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

Increment a field by 2 with a condition that another field has been changed by 2

Iga G
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 13, 2023

Hey,

I would like to increment a certain field with the smart value {{issue.customfield_15600}}, but when another field with a smart value {{issue.customfield_16800}} increases by +2. 

I tried to use those in the Edit field action of the certain field but it doesn't work or it counts wrongly. 

{{#=}}{{issue.customfield_16800}}+2 {{issue.customfield_15600}}+1{{/}}

{{#if((issue.customfield_16800.plus(2),issue.customfield_15600))}}
+1{{/}}

Thanks for helping out!

1 answer

0 votes
habib rahman
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.
March 19, 2023

Hi @Iga G My name is Habib, and I will do my best to help you please see below to your question.

 

To increment a certain field with the smart value {{issue.customfield_15600}} when another field with a smart value {{issue.customfield_16800}} increases by +2, you can use the following steps:
1. Navigate to the Jira workflow where you want to implement this automation.
2. Click on the "Edit" button to edit the workflow.
3. Select the transition where you want to add this automation. For example, if you want to increment the field when an issue is transitioned from "In Progress" to "Done", select that transition.
4. Click on the "Post Functions" tab.
5. Click on the "Add Post Function" button and select "Update Issue Field" from the dropdown list.
6. In the "Update Issue Field" dialog box, select the field that you want to increment. For example, if you want to increment the "Story Points" field, select that field.
7. In the "New Value" field, enter the following expression:

{{#if(issue.customfield_16800)}}{{#math}}{{issue.customfield_16800}} + 2{{/math}}{{/if}}{{#if(issue.customfield_15600)}}{{#math}}{{issue.customfield_15600}} + 1{{/math}}{{/if}}

This expression checks if the "issue.customfield_16800" field has a value, and if so, it adds 2 to that value. It also checks if the "issue.customfield_15600" field has a value, and if so, it adds 1 to that value.

8. Click on the "Add" button to add the post function.
9. Click on the "Publish Draft" button to save the changes to the workflow.
Once this automation is implemented, the selected field will be incremented by 1 whenever the "issue.customfield_15600" field increases by +2.

I hope this helps.

Thank you 

Habib 

Suggest an answer

Log in or Sign up to answer