Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom field logic, based on other field value

Vien Minh Van
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2023

Hi!

Is it possible to have a custom field that will be filled with an automated score on my issue, depending of the value of 2 other custom fields filled manually that will define the complexity and impact of the issue.

Example :

Possible values for complexity :

  • High (1pts)
  • Medium (2pts)
  • Low (3pt)

Possible values for impact : 

  • High (3pts)
  • Medium (2pts)
  • Low (1pt)

 

I would like to have my score field to display the numerical result of = complexity * impact.

This score will then help us address our priorities or filter more easily our work.

 

Thanks for your help!

1 answer

0 votes
Oday Rafeh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 28, 2023

Hi @Vien Minh Van , 

You can try to do that using the scriptRunner add-ons and you can try this script there: 

def complexity = issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("Complexity"))
def impact = issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("Impact"))

if (complexity && impact) {
def score = 0
switch (complexity) {
case "High":
score = 1
break
case "Medium":
score = 2
break
case "Low":
score = 3
break
}
switch (impact) {
case "High":
score *= 3
break
case "Medium":
score *= 2
break
case "Low":
score *= 1
break
}
return score
} else {
return null
}
Vien Minh Van
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 28, 2023

Thanks for your help!  What you suggest requires an add-on ($). 

Would there be any ways to do it natively with what’s available by default in Jira?

Thanks!

Oday Rafeh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 28, 2023

Native Jira does not provide a built-in feature to automatically calculate a custom field's value based on the value of other fields.

You can either use a plugin like ScriptRunner or write a custom plugin to achieve this functionality.

Another possible workaround is to use a scripted field to calculate the score and display it in the issue navigator or on the issue view screen, but this won't be editable like a custom field.

I hope this helps!

Suggest an answer

Log in or Sign up to answer