Hello Atlassian Community,
I am trying to get a custom field that is based on a result from 5 more custom fields values (Drop-down Single). In the past I did this with Power Custom Fields SIL but now it's paid and we don't want to spend 2000$ only for this field. We have Adaptavist Scriptrunner license and I am sure we can do it with it?
So I have 5 custom fields with options: High, Medium, Low. Each of them represent a number (3,2,1).
The goal is that my custom field will show a value based on the SUM of these fields.
This should be really simple if you look at my code:
def damage = getCustomFieldValue("Damage")
def reproducibility = getCustomFieldValue("Reproducibility")
def exploitability = getCustomFieldValue("Exploitability")
def affectedUsers = getCustomFieldValue("Affected users")
def discoverability = getCustomFieldValue("Discoverability")
def damagerating;
def reproducibilityrating;
def exploitabilityrating;
def affectedUsersrating;
def discoverabilityrating;
def scoreTotal;
if ( damage == "Low" ){
damagerating = 1;
} else if ( damage == "Medium" ){
damagerating = 2;
} else if ( damage == "High" ){
damagerating = 3;
}
if ( reproducibility == "Low" ){
reproducibilityrating = 1;
} else if ( reproducibility == "Medium" ){
reproducibilityrating = 2;
} else if ( reproducibility == "High" ){
reproducibilityrating = 3;
}
if ( exploitability == "Low" ){
exploitabilityrating = 1;
} else if ( exploitability == "Medium" ){
exploitabilityrating = 2;
} else if ( exploitability == "High" ){
exploitabilityrating = 3;
}
if ( affectedUsers == "Low" ){
affectedUsersrating = 1;
} else if ( affectedUsers == "Medium" ){
affectedUsersrating = 2;
} else if ( affectedUsers == "High" ){
affectedUsersrating = 3;
}
if ( discoverability == "Low" ){
discoverabilityrating = 1;
} else if ( discoverability == "Medium" ){
discoverabilityrating = 2;
} else if ( discoverability == "High" ){
discoverabilityrating = 3;
}
scoreTotal = (damagerating + reproducibilityrating + exploitabilityrating + affectedUsersrating + discoverabilityrating)
if (scoreTotal >= 10) {
return "High";
}
if (scoreTotal >= 5) {
return "Medium";
}
if (scoreTotal < 5) {
return "Low";
}The field is not even show in the Screen where it's configured. When I try the Preview I get"
Result: null
Log:
2019-08-09 09:35:49,144 ERROR [runner.ScriptFieldPreviewRunner]: ************************************************************************************* 2019-08-09 09:35:49,144 ERROR [runner.ScriptFieldPreviewRunner]: Script field preview failed for field that has not yet been created groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getCustomFieldValue() is applicable for argument types: (java.lang.String) values: [Damage] at Script163.run(Script163.groovy:1)
Highly appreciate any help :)
if i understand it right the issue that is assigned to user "nobody" can't be moved into different columns on board?
every move to an other column is a transition.
1. you may check your workflow for possible transitions.
2. you may check the conditions on the transitions that there is no "only assignee condition" or "Permission Condition" set for transitions you want NON-Assignees or to perform
have a look at
https://confluence.atlassian.com/display/JIRA/Configuring+Workflow#ConfiguringWorkflow-conditions
Dear C.Faysal,
Many thanks for your response.
I am quite new to Jira can you dive in a bit more details where to change these settings, I am under default workflow copy and seem lost :(
Thanks,
Aquarius.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
no problem. welcome aboard.
so you say you use Jiras default workflow.
that means if your Issues are in status "Open" only the reporter can proceed to the next step because the condition on "Start Progress" is set to "Only the assignee of the issue can execute this transition."
what i recommend is copiing the Default Workflow and modify it to fit your needs.
Jira Default Workflow is a System Workflow and therefor not editable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so here we go.
Step 1)
browse to your workflowsand choose "copy" on "jira (Read-only System Workflow)"
Step 2)
after you named your copy you will be able to edit the steps/transition etc inside it. so first click on the transition "Start Progress"
you will get this

now you can delete this condition what will allow other users to perform "Start Progress" on the issue.
Step 3)
create a new workflow scheme and associate your previously created flow to it.

next window will ask for issue-types to assiciate the workflow with

you can start by choosing all unassigned to your new flow.
Step 4)
edit your project and add the new Workflow or switch Scheme to the newly created one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.