Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

ScriptRunner - Behaviours - Add default value to description field, unless it's edited.

I was able to add the default description. But, when a user edits the field and clicks away from it, it'll default back to the default value. Is there a way to check if the value has been changed?


def desc = getFieldById("description")
def currentIssueType =
def empty = ""
def defaultValue = """default value""".replaceAll(/ /, '')

def bugDefaultValue = """

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

if (! underlyingIssue?.description) {
if(currentIssueType == "Epic" || currentIssueType == "Story"){
}else if (currentIssueType == "Bug"){

1 answer

1 vote
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jun 09, 2020

You may consider running your Behaviour only on a Create, and not on an edit. We use this code snippet at the top of a Behaviour for that purpose:

// We wish to run this behaviour only during a Create.
// Per :
// getActionName() "Returns the name of the current action if the issue is undergoing a workflow action, null otherwise."
// Create is a workflow action, so it will return "Create Issue" or "Create" (should check for both).
// Edit is not a workflow action, so it will return null.
if (getActionName() == null || !(getActionName() in ["Create Issue", "Create"])) {

The issue is during the create step. Before the create button is pressed, if the user wanted to clear the default data and add their own, the default data would return upon leaving the description field.

I've decided on using a workaround. Having radio buttons that correlate with whatever default value they want. If they want to enter their own data they would simply choose none.


def descriptionField = getFieldById("description")
def radioSelect = getFieldByName("descriptionTest")
def radioSelectValue = radioSelect.getValue()

def text = """

DESCRIPTION DEFAULT VALUE 1""".replaceAll(/ /, '')

def textTwo = """

DESCRIPTION DEFAULT VALUE 2""".replaceAll(/ /, '')

if(radioSelectValue == "Bug Issue Type"){
}else if(radioSelectValue == "Other"){

Hi Raynard, 

have the same issue :-(

Do you already have any solution for this challenge? 


Regards, Sergo

No, I decided to use radio buttons that would have the default text. When the radio button is selected the Description field will be populated with whatever corresponds with that button. Also a clear text button if the default description isn't needed.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events