Two Factor Priority Fields

I would like to create a new priority field that is automatically calculated from two other single dropdown fields or a single cascading dropdown field (whichever is easier). The two factors would be below Frequency (4 options) and impact (12 options), and based on those inputs the new priority would be calculated. 

 

Is this possible using Script Runner?

3 answers

This widget could not be displayed.

Hi Bryan,

Taking Gabrielle and Doug's comments a little further, the code you'll want will look something like this:

def frequency = getCustomFieldValue("Frequency").getValue()
def impact = getCustomFieldValue("Impact").getValue()
 
if (frequency && impact) {
	switch (frequency) {
		case "First Frequency":
			switch (impact) {
				case "First Impact":
						return "something"
				case [...]
			}
		case [...]
	}
}

Obviously, replacing the switch/case statements with whatever logic you're after (I include those as a simplistic example).  If you have any other questions, please post here.

Hi Jamie, Thank you so much for the information. This is very helpful. I used your Query in the inline script field for the "True Priority" Script field. I am not able to return anything. The "True Priority" field doesn't even show on the issue even though it has been added to the screen. Here is the Query I am using, for only one case to test. def frequency = getCustomFieldValue("Frequency").getValue() def impact = getCustomFieldValue("Impact").getValue() if (frequency && impact) { switch (frequency) { case "Always": switch (impact) { case "Security: In Production": return "P1" } }

Hi Jamie, Do you have any insight on this?

This widget could not be displayed.

The "Scripted Field" can do this. Alternatively, a "Post function" to "Set Field Value to constant or Groovy expression" can do that too with Conditional Execution based on what you need.

This widget could not be displayed.

As Gabriella said - Yes this is possible with a Script Runner scripted field. We do something very similar.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

304 views 1 4
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you