Forums

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

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

Raynard Rhodes
Contributor
June 9, 2020

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 = issueContext.issueType.name
def empty = ""
def defaultValue = """default value""".replaceAll(/ /, '')

def bugDefaultValue = """

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

if (! underlyingIssue?.description) {
if(currentIssueType == "Epic" || currentIssueType == "Story"){
desc.setFormValue(defaultValue)
}else if (currentIssueType == "Bug"){
desc.setFormValue(bugDefaultValue)
}else{return}
}

1 answer

0 votes
Deleted user
October 21, 2013

JEMH can do that. There is a Profile > Security > Default reporter overides derived checkbox.

Suggest an answer

Log in or Sign up to answer