Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Update custom filed values based on selecting custom filed Values.

Edited

1.png2.png3.png

We Have custom fields called 1) initial Impact and 2) initial Probability and 3) initial rating
The filed values are alpha and numeric:-

1- Very Low – 10%

2- Low – 30%

3- Medium – 50%

4- High- 70%

5- Very High- 90%
Now the requirement is by selecting the Values of Initial Impact and initial Probability. Then the value of Initial rating should be generated automatically.Field values.png

1 answer

I have Edited Formula Based on Our Values. but it's not working. while creation of issue there is no changes.

import com.atlassian.jira.issue.IssueFieldConstants
import groovy.transform.BaseScript
import com.onresolve.jira.groovy.user.FieldBehaviours

@BaseScript FieldBehaviours fieldBehaviours

def ratingMatrix = [
'Very high - 90%' : [
'Very High - 90%' : 'High - 70%',
'High - 70%' : 'High - 70%',
'Medium - 50%' : 'High - 70%',
'Low - 30%' : 'High - 70%',
'Very Low - 10%' : 'Medium - 50%',
],
'High - 70%' : [
'Very High - 90%' : 'High - 70%',
'High - 70%' : 'High - 70%',
'Medium - 50%' : 'High - 70%',
'Low - 30%' : 'Medium - 50%',
'Very Low - 10%' : 'Medium - 50%',
],
'Medium - 50%' : [
'Very High - 90%' : 'High - 70%',
'High - 70%' : 'High - 70%',
'Medium - 50%' : 'Medium - 50%',
'Low - 30%' : 'Medium - 50%',
'Very Low - 10%' : 'Low - 30%',
],
'Low - 30%' : [
'Very High - 90%' : 'High - 70%',
'High - 70%' : 'Medium - 50%',
'Medium - 50%' : 'Medium - 50%',
'Low - 30%' : 'Low - 30%',
'Very Low - 10%' : 'Low - 30%',
],
'Very Low - 10%' : [
'Very High - 90%' : 'Medium - 50%',
'High - 70%' : 'Medium - 50%',
'Medium - 50%' : 'Low - 30%',
'Low - 30%' : 'Low - 30%',
'Very Low - 10%' : 'Low - 30%',
]
]

def impactFieldValue = getFieldByName('Initial Impact').value as String
def probabilityFieldValue = getFieldByName('Intial Probability').value as String

def rating = ratingMatrix[impactFieldValue][probabilityFieldValue]
def ratingField = getFieldByName('Initial Rating')
ratingField.setFormValue(rating)

This is the formula i'm using in Behaviors.

Pls Help on this.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you