Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you troubleshoot missing default values in Multi-line Text Custom field?

Priscilla Achampong April 9, 2020

Hi All,

I'm aware of two options of adding default values to a custom field, by editing the field or using behaviours. Unfortunately the inputted text isn't appearing as expected. 

Custom Field

I updated the custom field directly adding a default value, but the text isn't appearing. I re-indexed the project and restarted browsers, but no joy.

 

Behaviours 

I recycled and tweaked behaviours which already work for other custom fields, but no joy. (script versions below) However, when using script in conjunction with an issue type for a different custom field worked. Although assigning an issue type and using my custom field didn't work.

Version 1:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue

def desc = getFieldById("customfield_xxxxx")

def defaultValue = """h4. Header One

- Add text here.

h4. Header two

- Add text here.""".replaceAll(/ /, '')

Version 2:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue

def desc = getFieldById("My Custom Field")

def defaultValue = """h4. Header One

- Add text here.

h4. Header two

- Add text here.""".replaceAll(/ /, '')


Making both updates haven't made the new text appear.

I would appreciate help on how to troubleshoot and ultimately fix this issue.

Thanks.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events