Hi,
I used the following script to pre-file description field.
def desc = getFieldById("description")
def issueType = getFieldById("issuetype")
def defaultStory = """ Story text """
def defaultBug = """ Bug text """
def defnull = """ """
if (getActionName() == "Create"){
if (issueContext.issueType.name =="Story"){
desc.setFormValue(defaultStory)
}
else if (issueContext.issueType.name =="Bug"){
desc.setFormValue(defaultBug)
}
else {
desc.setFormValue("")
}
}
During the creation, If I select another project the description is the same (If it was a story, description is still equal to "Story text"). I have set the behaviour only for one project but there is no clean.
How can I reset the description field on the creation page if we change to another project (not the one selected on the behaviour setting)?
Thank you in advance for your help.
Regards,
Mickael O.
This is JIRA default behavior to keep the field values in create screen, when you switch projects.
If you want to clear the description value you can create a new behavior with global context with the following initializer:
def desc = getFieldById("description")
if (getActionName() == "Create" && issueContext.projectObject.key != "PROJECTKEY"){
desc.setFormValue("")
}
You must replace the PROJECTKEY with the project that you are using your behaviour that will set story and bug templates.
I think this approach will work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.