Hi Team,
We have set the below code as default description for Improvement issue type for a Project with many issue types.
def desc = getFieldById("description")
def defaultValue = """Required functionality / Needed changes:
<describe what is needed and expected behavior>
Reason for request:
<describe why it is needed (benefit if implemented / impact if not implemented)>
""".replaceAll(/ /, '')
if (!underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
The behaviour works fine if we try to create new issue in new tab/window but if we create or change the issue type other than "Improvement" in the same form then the default behaviour still shows.
Behaviour is set just for Improvement Issue type.
Let us know your suggestions.
Thanks!
Hi Catheline,
My guess is that you have this Behaviour on the Description field. You should put this Behaviour on the Issue Type field instead of the Description field so that it will run the Behaviour every time the Issue Type field is updated. You should also change the Mapping to All Issue Types instead of just "Bug" and use this slightly modified code instead:
def desc = getFieldById("description")
def defaultValue = """Required functionality / Needed changes:
<describe what is needed and expected behavior>
Reason for request:
<describe why it is needed (benefit if implemented / impact if not implemented)>
""".replaceAll(/ /, '')
def issueType = getIssueContext().getIssueType().name
if (issueType == "Bug") {
if (!underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
} else {
desc.setFormValue(" ")
}
Hi Carmen,
Thank you for the inputs, we will try and let you know.
Also, we want this default only for the create Issue form not for Edit Issue.
Please let us know what we should do for this.
Thank you,
Catheline
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.