Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


How to make a behaviour work on Edit screen but not when the Edit dialog opens?



I'm working in a new issue type which has two fields (input required). In this context, I'll call them field A and field B.

Both fields were created using ScriptRunner plugin and both of them are Database pickers.

Field B will run an SQL query using the value which was provided in field A and to avoid unwanted results, I've created a behaviour.

This behaviour will make field B as a read-only field in the Initialiser script, since the value for field B should only be selected after field A value is picked.

Also, I've added a script for field A which will clear the value for field B and make it editable if the value for field A value is different than null. If the field A value is equal to null, this script will also clear the field B and make it read-only.


This is working as expected in the Create issue action, however I've found an unexpected result while trying to Edit the issue.

When the Edit dialog shows up, the field A has the previously selected value but field B is null.

I suppose this happens due to the fact that once the Edit dialog appears the field A is mapped with the value given earlier and the behaviour is triggered because the plugin detects that the field A value was changed.


Is there a way to make the behaviour trigger only when the field is clicked on and make it so the behaviour is not triggered when the Edit dialog shows up?

For reference, I'm sharing the script for field A below:


def fieldB = getFieldByName('Field B')
def currentValue = getFieldById(getFieldChanged())
String auxValue = currentValue.getValue() as String
switch (auxValue){
   case {auxValue != null && auxValue != ""}:
   case {auxValue == null || auxValue == ""}:
All ideas are welcome. Thanks in advance for your feedback.


0 answers

Suggest an answer

Log in or Sign up to answer