Hi,
Sorry for this post,
Should be a very easy and basic question, but I don't know how to do it.
I have 3 number fields.
Let's call N1, N2, N3.
I need a new Number Field N4 with the value of:
N4 = N2 * N3 + N1
How can I do it?
Side note: I Have Script Runner installed just in case.
The result is not needed to be present and be dynamic in the edit/creation screen.
Found this article:
Implemented as Automation, every time the source fields are edited.
Allow me to make an exclusion if some values are missing.
Story Points is not empty
RICE Score Reach is not empty
RICE Score Impact is not empty
RICE Score Confidence is not empty
do:
RICE Result:
{{#=}} ({{issue.customfield_14208}} * {{issue.customfield_14209}} * ({{issue.customfield_14210}}/100)) / {{issue.customfield_10106}} {{/}}
Do you need N4 to be editable by users after it has been calculated? And kept up to date if N1, N2 or N3 are changed?
If not, then I'd use a scripted field for this. This script at https://library.adaptavist.com/entity/populate-a-scripted-field-with-the-sum-of-all-values-added-or-updated-in-a-number-field is not a bad start, you can remove the stuff about change history, and add lines for getting the values of N2 and N3 and then do a simple calculation.
If you want to put the answer into a field, then you can combine that with writing the target field in https://library.adaptavist.com/entity/change-the-value-of-a-custom-field-in-a-post-function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you looking for displaying the value of N4 at the time of creation of ticket or after the creation?
If it is after the creation of ticket, you can use automation rules or if you have 'Jira Workflow Toolbox' plugin installed, you can have the N4 as the custom field of 'Calculated Number Field' and specify the expression accordingly.
In case if you are looking for displaying the value at the time of creation of ticket, provided the values for all the three custom fields (N1, N2 and N3) are given by the user, you can use the script in ScriptRunner to display that.
Hope this helps.
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.