You'll need to write a custom field type add-on to do that, but I'd strongly recommend using one of the addons in the marketplace that can do it. Script Runner can do scripted fields, and it's the only one I'm familiar with. You may find others suit you better though.
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