Hello,
I have a question and I could not find something about it.
Please note that I'm very new with the tool.
I would like to create a field (custom field) where the value has a certain weight according to the selected value.
And at the end I would like to display the result of all weights (additional)
I will be easier to understand with an example:
Question 1 : How many users ?
Question 2 : Deployment time ?
Let' assume the choices are respectively (3 users and 90 mins) - the weight would be (20+40) 60
I'd like the user to chose one answer per question and the result (weight) to be calculated automatically and displayed at the end of the form.
Is this possible? If yes - how ?
Please note that I installed (trial version) the Jira Misc Custom Fields (JMCF) plugin.
Many thanks.
Kind regards,
Chris
with JMCF, you'll be able to create a Calculated Number field that represents the total weight. However, the value will only be visible after the "form" (I assume you mean the issue creation screen or a transition screen, or maybe a Jira Service Management request creation form) is submitted. The field will be visible on the issue view after its creation.
Would that work for you?
Dear David,
Thanks for your answer.
Yes, it should be ok as from the moment the value is displayed before the validation.
How can I proceed, currently I'm not even able to assign a weight to an answer.
Thanks
Regards,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use a formula like this:
def weight = 0
switch (issue.get("Question 1 : How many users ?")) {
case "2 users":
break;
case "3 users":
weight += 20;
break;
case "4 users":
weight += 50;
break;
}
switch (issue.get("Question 2 : Deployment time ?")) {
case "30 min":
break;
case "60 min":
weight += 30;
break;
case "90 min":
weight += 40;
break;
}
return weight;
Of course, you'll need to make sure the values and field names match exactly your setup. You might also want to replace field names with field IDs - use the "Issue Fields" help tab at the bottom of the script editor to find the field IDs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello David,
Thanks for the formula.
I was able what I wanted :)
Regards,
Chris
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.