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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Cache problem when autopopulated to particular issuetype

Hello Adaptavist,

Auto-populated some content in Description for a 'Bug' issue type in Particular Project, when we change the issue type from Bug to other, the description remains the same.

FYI: From other issue types to Bug, auto-populate is working as expected.

And also i have tried with

enableCache = {-> false}

Getting an error, please check attched screenshot.

Screenshot (69).png


1 answer

0 votes

In order to have the behavior script "kick in" when you change to other issue types or projects, you will need to use all issue types and all projects in the behavior mapping.

Then, in your script, check the issueContext.project.key and and then populate with your default when they match and populate with empty strings when they don't.

The one caveat you should be aware of is that any text typed by the user in the description will be erased if they happen to change their mind mid-creation on which issue type it should be.

You could avoid that by first comparing the current form value against the default, and reset only if they match.

The enableCache = {-> false} is only applicable for scripted field as far as I can tell from the documentation.

Hi @Peter-Dave Sheehan 

Could you please explore in detail, so that i can understand.



Behavior script only executed when you change TO a project/issue type that is in the mapping.

When you change FROM a mapped issue type or project to one without mapping, then no script is executed.

So if you set your mapping to All Project and All Issue Types and start your script this way:

def myMapping = [projects: ['ABC', 'XYZ'], issueTypes:['Bug']]
def defaultDesc = """\
Put your default desc here.
def descField = getFieldById('description')

//only try to set defaults during issue creation
if (!underlyingIssue) {
//check that the issue being created is in a context where we want the default
if(issueContext.projectObject.key in myMapping.projects && in myMapping.issueTypes){
} else {
//clear the default, but only if user hasn't made any changes yet
if(descField.value == defaultDesc){

Hi @Peter-Dave Sheehan 

I have tried this too, but no luck.

And below is the code i have used before for particular project and issuetype is bug.


def desc = getFieldById("description")
def defaultValue = """
*Steps to Reproduce:*
*Expected Results:*
*Actual Results:*
""".replaceAll(/ /, '')
// Only overwrite the description if it's not already set

if (!underlyingIssue?.description) {


Even after tried with your code, the issue is remains same.

Please let me know how to solve this.



Can you share screenshots of the behaviour mapping and the field configuration screens?

Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you