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

Setting default value for Organizations using Scriptrunner Initialiser or Behaviour?

Has anyone had any success in setting the Organizations field on an open form using an Initialiser or Behaviour in ScriptRunner? Ideally I'd like to be able to automatically set the initial form value of the Organization that appears on the "Share with..." field in a customer Request Type, but I can't even get Scriptrunner to set the Organizations field on a form with a initialiser or behaviour.


Again, this is just about setting what value appears on the form, before it's been submitted; no issues validating or changing the Organizations field once the ticket has been submitted.

1 answer

0 votes

I had a similar requirement but I was never able to interact with the "Share with" options in the portal.

I ended up using a script listener. I don't remember why I chose that over a postFunction.

Unfortunately, that doesn't help with setting a default option that the user would then be able to override with their own selection, if desired.

You are correct.

In my case, I never have a reason to allow customers to leave their tickets private.
If the customer selects an organization to share to, I leave that selection it (useful if they have access to more than one). If they leave it blank (private) I add the default one.

You would need to create additional custom fields to let the customer choose what they want and use those selections in the script. 

Scriptrunner Behaviour is simply just not designed to interact with the "Share With.." control on the portal form since it's not a standard field.

It doesn't seem like it's designed to interact with the Organizations field in general - I can't set that field using a behavior in the regular portal either.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

723 views 7 24
Read article

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