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}
}

2 answers

1 accepted

0 votes
Answer accepted
Darly Senecal-Baptiste
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 Champions.
May 15, 2014

Answer:

At a Crucible code review, you just need to edit the code review and unlink the commit that you don't want.

Click on Edit Details > Add Content > Browse Changesets. Then you can unthick the commit that you accidentaly did.

But there is one caveat: Make sure that your undersired commit files don't have a inline comment. Otherwise, Crucible won't allow you unlink the commit from the code review.

Then click Done.

Thanks

0 votes
Darly Senecal-Baptiste
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 Champions.
March 3, 2014

Another point to mention is that each commit is linked to different JIRA issue ticket. Also, while checking the commits, I figured out that user was copying part of the repositories to another folder.

Thanks

Suggest an answer

Log in or Sign up to answer