Populate field with calculation when another field is changed

Hi, I need to multiply the estimation field by a level of difficulty when the estimation field is changed and put that value in a third field for total estimation. Does anyone have an idea on how to do this? I am a workflow noobe but an old developer, any help with be greatly appreciated. 

 

thanks in advance for any help you may give.

1 comment
Comment actions Permalink
Official comment

Hi,

I have already answered you in a support request but will duplicate the answer here just in case.

You will need an on-change workflow rule which fires when a certain condition is met. 
Here you can find several examples of workflows: https://www.jetbrains.com/help/youtrack/incloud/Default-Workflows.html.
For example, this workflow (https://www.jetbrains.com/help/youtrack/incloud/Workflow-Wont-Fix-Build.html) updates the "Fixed in Build" field when issue's state is changed to Won't Fix.

Basically, the main logic of your workflow will be very simple, a line which performs something like ctx.issue.totalEstimation = ctx.issue.Estimation * ctx.issue.levelOfDifficulty;
Besides that, you'll need to define these fields in the Requirements section (please refer to https://www.jetbrains.com/help/youtrack/incloud/requirements.html; an example can be found here: https://www.jetbrains.com/help/youtrack/incloud/Workflow-Task-Assignee.html) and compose a guard condition which defines when your workflow should trigger (please refer to https://www.jetbrains.com/help/youtrack/incloud/on-change-rules.html).
Please refer to https://www.jetbrains.com/help/youtrack/incloud/Quick-Start-Guide-Workflows-JS.html to learn workflows basics and do let me know if you face any problems.

Please sign in to leave a comment.