case 1
impact = low severity = low then priority= low
case 2
impact = low and severity is medium then priority = low
case 3
impact = low and severity is high then priority = medium
case 4
impact = medium severity = low then priority= medium
case 5
impact = medium and severity = medium then priority = medium
case 6
impact = medium and severity = high then priority = high
case 7
impact = high severity = low then priority=high
case 8
impact =high and severity is medium then priority = high
case 9
impact = high and severity is high then priority = critical
You can do this using the behaviours plugin...scripting is up to you though:
https://marketplace.atlassian.com/plugins/com.onresolve.jira.plugin.Behaviours
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi how i can use that plugin can i have any scripts in place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the relation between impact and severity with priority is fixed, why do you want to show the priority field itself in the screen? Accept the two values from the user for impact and severity and automatically set the value of priority in the post function using script runner plugin.
https://jamieechlin.atlassian.net/wiki/display/GRV/Script+Runner
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Please correct my script it is not working
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
FormField priority = getFieldById("priority")
FormField impact = getFieldById("impact") // Your customfield
Object impactValue = impact.getFormValue()
FormField severity = getFieldById("severity") // your customfield
Object severityValue = severity.getFormValue()
if((impactValue== "Low") && (severityValue == "Low"))
{
priority.setFormValue(Low)
}
if((impactValue== "Low") && (severityValue == "Medium"))
{
priority.setFormValue(Low)
}
if((impactValue== "Low") && (severityValue == "High"))
{
priority.setFormValue(Medium)
}
if((impactValue== "Medium") && (severityValue == "Low"))
{
priority.setFormValue(Medium)
}
if((impactValue== "Medium") && (severityValue == "Medium"))
{
priority.setFormValue(Medium)
}
if((impactValue== "Medium") && (severityValue == "High"))
{
priority.setFormValue(High)
}
if((impactValue== "High") && (severityValue == "Low"))
{
priority.setFormValue(High)
}
if((impactValue== "High") && (severityValue == "Medium"))
{
priority.setFormValue(High)
}
if((impactValue== "High") && (severityValue == "High"))
{
priority.setFormValue(Critical)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please, too long tittle, edit it !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are new to behavoiurs plugin things will become more simpler if you go through the documentation of the plugin first , there are many examples provided in the documentation .
Below is an untested script , you will have to modify it accordingly
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
FormField priority = getFieldById("priority")
FormField impact = getFieldById("impact") // Your customfield
Object impactValue = impact.getFormValue()
FormField severity = getFieldById("severity") // your customfield
Object severityValue = severity.getFormValue()
//pseudo logic .. syntax not tested ... not exaclty as per your requirement
if(impactValue==severityValue)
{
priority.setFormValue(impactValue)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi can i use this script for online editing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No , if the fields are editable via inline edits then the script will not work . I guess this is handled by the plugin , if not you will need to turn off inline editing from General Configurations page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi mizan actuall y i cant understand some finctionality in the scripts will u transfer this script in to english please.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Sorry my short answer... bellow, a snippet code in Groovy (script "runner" post-function in "create" transition) used in one of our customers:
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import webwork.dispatcher.ActionResult;
import com.atlassian.core.ofbiz.CoreFactory;
import com.atlassian.core.util.map.EasyMap;
import com.atlassian.jira.action.ActionNames
import org.ofbiz.core.entity.GenericValue;
import com.atlassian.core.ofbiz.CoreFactory
import com.atlassian.core.util.map.EasyMap
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.util.ImportUtils
import com.atlassian.jira.issue.index.IssueIndexManager
import com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem
import com.atlassian.jira.issue.*
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.opensymphony.workflow.InvalidInputException
import org.apache.log4j.Category
def log = null
try{
log = Category.getInstance("log.foobarwar.groovy");
log.debug("INICIANDO SCRIPT setPriopridade.groovy")
}catch(Throwable e){
System.out.println("ERRO ao obter a instancia do log4j")
e.printStackTrace();
return
}
ProjectManager projectManager = componentManager.getProjectManager()
//IssueManager issueManager = componentManager.getIssueManager()
//issueManager.getIssueObject( "UNILTM-36" )
MutableIssue mIssue = issue //Mutable issue
if( mIssue == null ){
System.out.println("Não foi possivel obter a instancia da tarefa")
return
}
// Matriz no formato [[[Urgencia,Impacto],Prioridade],...]
// Critica=2, Alta=3, Média=4 e Baixa=5
def matrizDePrioridade = [[["Alta","Alto"],"2"],[["Alta","Médio"],"3"],[["Alta","Baixo"],"4"],[["Média","Alto"],"3"],[["Média","Médio"],"4"],[["Média","Baixo"],"5"],[["Baixa","Alto"],"4"],[["Baixa","Médio"],"5"],[["Baixa","Baixo"],"5"],[["High","High"],"2"],[["High","Medium"],"3"],[["High","Low"],"4"],[["Medium","High"],"3"],[["Medium","Medium"],"4"],[["Medium","Low"],"5"],[["Low","High"],"4"],[["Low","Medium"],"5"],[["Low","Low"],"5"]]
def campoUrgencia = "customfield_10160"
def campoImpacto = "customfield_10161"
//Pega o valor do custom field Urgencia
String fieldValueUrgencia = (String)mIssue.getCustomFieldValue( ComponentManager.getInstance().getCustomFieldManager().getCustomFieldObject( campoUrgencia ) )?: "";
// Pega o valor do custom field Impacto
String fieldValueImpacto = (String)mIssue.getCustomFieldValue( ComponentManager.getInstance().getCustomFieldManager().getCustomFieldObject( campoImpacto ) )?: "";
//log.warn("Urgencia =" + fieldValueUrgencia + " e Impacto = " + fieldValueImpacto)
//Obtem a prioridade da atual tarefa conforme urgencia e impacto
def prioridade = ""
for (prioridades in matrizDePrioridade) {
urgenciaImpacto = prioridades[0]
// log.warn(urgenciaImpacto)
if (urgenciaImpacto[0].contains(fieldValueUrgencia) && urgenciaImpacto[1].contains(fieldValueImpacto)) {
prioridade = prioridades[1]
break
}
}
//Valida se o usuario corrente esta somente em um grupo
if (prioridade.equals("") ) {
log.warn("Problemas no calculo do campo Prioridade, Administrador do Sistema favor verificar a execução desta regra.")
return
}
// Seta o valor da prioridade calculado
mIssue.setPriorityId( prioridade )
//Persiste a tarefa com as alterações
mIssue.store()
//log.warn("Campo Prioridade setado com o valor " + prioridade + " com sucesso para issue " + mIssue.getKey())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
where can i use this script and how can i modify this to my requirement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you intend to calculate the priority of a risk, maybe you should take a look in the following plugin: https://marketplace.atlassian.com/plugins/com.ja.jira.plugin.report.riskmanagement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dinesh,
Please modify this script accordingly.
Below script will work for if you want to autocopy data from one field to another. Design and modified script accordiangly and put in Description section of the field.
<script>
AJS.$(document).ready(function(){
AJS.$("input[name=customfield_xxxxx]").blur(function () {
var prjname= document.getElementsByName("customfield_xxxxxx")[0];
var summary= document.getElementsByName("summary")[0];
summary.value = prjname.value;
});
});
</script>
Good Luck!!
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.