Create
cancel
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

Auto-populating multi-line text field (Scriptrunner Behavior)

I have been using the following Behaviors script to auto-populate the Description field with some canned text from the create screen:

def desc = getFieldById("description")

def defaultValue = """

Default Text Here

""".replaceAll(/ /, '')

if (!underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}

I'm looking to setup the same behaviour for a custom multi-line text field I've named "Reference Links".

Can someone help with the syntax needed to accomplish this? Thanks!

2 answers

1 accepted

0 votes
Answer accepted

You only need to change from this:

def desc = getFieldById("description")

to this:

def desc = getFieldByName("Reference Links")

The rest should be the same

Hi Raziman

I used same code in my jira  for the same Description field

But it applied to globally for all project even i limited to one project and issue type.

Can you suggest how i can restrict to only the single project

 

Thanks 

Vishal

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🎨 Add some visual life to your templates

Hi Atlassian Community, My name is Avni Barman, and I am a Product Manager on the Confluence Cloud team. Based on feedback from you, we are giving admins more power to create templates that a...

183 views 3 8
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