Behaviors not behaving

I'm trying to configure a JIRA plug-in called Behaviors to calculate a field by using data from two other fields. So far I've had no luck with the configuration or online help.

I am unable to figure out the exact issue here. Somehow, our script is unable to read the “formField” object. This object is supposed to be activated with Behaviors plugin as it (formField object) is not available with JIRA’s default classes:

Any guidance is helpful.

6 answers

Can you post the xml of the behaviour you've got troubles with ?

Please see the code posted by my team mate Vaibhav below. Does that give you enough info to help us out?

0 votes

Hello Josh,

here some examples

If you provide us your code we can help you on that.

Please make sure that you defined a correct mapping (project/issue type) for your behaviour.

Hope this helps,


Please see the code posted by my team mate Vaibhav below. Does that give you enough info to help us out?

Hi guys,

I belive I have done proper mappings. Below is the simple behaviour's code we are facing trouble with:

F1 = getFieldByName('MyFieldInput1').getValue()
F2 = getFieldByName('MyFieldInput2').getValue()

FormField out = getFieldByName('MyFieldOutput')

if (F1 == 'Likely' && F2 == 'Critical') {

Requirement: Based on the values set in MyFieldInput1 and MyFieldInput2, my 3rd JIRA input field's value should be influenced.

Like in above case if the values in MyFieldInput1 and MyFieldInput2 are "Likely" and "Critical" respectively, then my out JIRA field should have text value as: "R1"

What type of field is MyFieldOutput?

Add some logging, eg

log.warn ("F1: " + F1)
log.warn ("F2: " + F2)

and look in the jira log after activating the bejaviour.

Also please don't start your variables with an upper case char.

In private emails you said that all fields are select lists.

To set a select list value you will need to send the option ID, which is like 12345.

This is not ideal but this is how it works right now. Maybe in future there will be a setValue() method, like the getValue() method, which has a bit more smarts.

Hi Jamie,

Thanks for your reply. I'll work on your suggestion and revert with the results.

Hi Jamie,

Where to get this option ID?

Also, the field which is being set depeding on the other two "Select List" fields is "Scripted Field".

Should I change the output field to text field?

This is not making any sense. You can't set the value of a scripted field.

You modify the script field code so that it returns a value based on the two select lists.

Oh, I thought that since the output filed is changing as per the script, we are required to set it to "Scripted Field"

Should I change the output field to "Text Field" if that will make it smooth?

You can use a behaviour to set a text field from other the values of other fields.

You can use a script field to display a value based on other fields.

The first approach lets the user override the value. Horses for courses.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,050 views 4 9
Read article

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