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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

ScriptRunner Behaviour not working on Edit Screen

Hello everyone

I have a behaviour which requires the user to set an assignee based on the selected issue security. The assignee cannot be unassigned.

This works just fine when creating an issue. On the Edit Screen however, it does not. I can edit an unassigned issue, set the appropriate issue security and it will be accepted without an assignee set.

I debugged the script and can confirm that it enters the desired if condition and should set the field to required.

grafik.png

grafik.png

What am I missing here?

Thanks and BR

Marius

1 answer

1 accepted

0 votes
Answer accepted

Please ignore (I can't delete the question). One of my workflow validators was responsible for the desired action. The behaviour works.

Please what happend actually . Because i am facing the same issue .

My Script runner Script behaviour is working for create screen but not working for edit screen .

Script runner Version:6.15.0  

 

Script code :

-----------------------------------------------------------

import com.onresolve.jira.groovy.user.FormField

 

def donorNameField = getFieldById("customfield_12331") // i.e Donor name field i.e Dropdown field
def donorNameFieldValue = donorNameField.getValue()


def OtherDonerNameField = getFieldById("customfield_11902") //ClearField field i.e Other Doner Name field

donorNameField.setRequired(true)
//-----------------------------------Logic To set text box to empty when you select "Other option from Drop down"------------------

if(donorNameFieldValue.toString().contains("Other"))
{


OtherDonerNameField.setHidden(false); // To Show it ---> we use "false"

OtherDonerNameField.setRequired(true)
}

else
{




OtherDonerNameField.setHidden(true); // To hide it ---> we use "true"

OtherDonerNameField.setFormValue(null) // to set empty when "other" is selected from dropdown , we passed Null to formField

OtherDonerNameField.setRequired(false)

}

 

-------------------------------------------------

Suggest an answer

Log in or Sign up to answer
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