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, jira product discovery, jpd premium, product management, idea management, product discovery, jira premium, product planning, atlassian community, product development, roadmap planning, product prioritization, feature management

Introducing Jira Product Discovery Premium ✨

Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.

Learn more
AUG Leaders

Atlassian Community Events