How to clear default description on create issue screen while changing to other project on same

Hello Team,

We have "behaviours" plugin which is part of Script Runner. Applied behaviours for default description on particular issue type on particular project using field mapping.

Here i applied on "ABC" project for story issue type. When i selected story the default description is displaying automatically, but when i changed other project like "XYZ" on same create screen, the default description is remaining same.
How can i clear the description auto filling filed when the changed the project name on same create issue screen. Please suggest on this.

I can't apply on particular workflow transition, because ABC project schemes is using shared configuration, it affects 61 project.

 

 

Here is the code,

 

def desc = getFieldById("description")

def defaultValue = """*Background / Description* :

*Acceptance Criteria :* I'll know this is done when -

*Supported APIs ( Available / Usable)* :

*Experiment ( y / n , % of populate it effects )* :

*Design ( desktop / Mobile included ? )* :

*Clickstream Requirements (with scenarios )* :

*Google Analytics Requirements (with scenarios )* :

*Appboy Requirements (with scenarios )* :

*VQA by ?* :

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

if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}

1 answer

0 votes

Hi,

Your code appears not to be correct, since you are using replaceAll(/ /,") which seems like not the proper way of calling the function.

Why would you call replaceAll when your string is static to begin with? You could just simply place all of the string as you wanted it to be there.

Do the following

def desc = getFieldById("description")def defaultValue = """*Background / Description* :"""
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}

Does that work?

Cheers!

Dyelamos

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

2,572 views 5 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you