Hello,
I have a request to create a calculated custom field.
I have 2 fields,
User want to divide UST Adjusted by Time Spent and store the output in a new custom field Productivity.
For this, I created a Calculated Number Field by JWT and wrote the formula as,
Math/Numeric expression: {UST Adjusted}/{Time Spent}
But, It is not working for me. I am not sure, why!
For that I tried to search on community and found this - https://community.atlassian.com/t5/Jira-Software-questions/Divide-one-Number-field-by-another-number-field-and-add-output/qaq-p/1381732
When I found some script in the link, I am not sure where to write it in my Jira instance. I don't have a script runner plugin installed.
Could you please help me create a calculated custom field?
Also, Time Spent is filled after the issue is solved, So User wants it to work whenever the time is logged on the issue (if time is not logged at the beginning)
@Martin Bayer _MoroSystems_ s_r_o__
Thanks,
Sangmesh
Hi @Sangmesh
your JWT calculated number field might not work with the current expression, if the fields are empty. So you might want to update your expression to something like this (if you are using JWT >= 3.0):
{issue.timeSpent} != null and {issue.cfaaaaa} != null ? {issue.cfaaaaa} / ({issue.timeSpent} / 60) : null
For JWT < 3.0 your expression would be:
{00025} != null and {aaaaa} != null ? {aaaaa} / ({00025} / 60) : null
where aaaaa is in both cases the field code of the field "UST Adjusted".
I also added the ... / 60 ... because the total time spent field returns the time in minutes and this way we transform the output to hours.
With this expression, the calculated number field will be empty as long as not both fields are set. As soon as both are set, the value will be calculated and displayed. But this logic can also simply changed by updating the expression in front of the question mark.
Cheers
Jona
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will need to install one of the scripting apps to do this, or use Automation for it (which won't do it with a script)
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.