I am trying to add a template to the comments field for select transitions, that can be edited by the user in the transition screen.
I have tried the following with no success:
I tried using Behaviours to set the comment field but it seemed like it could not locate the comment field.
I tried using the service desk template, but once again nothing showed up.
Maybe I am just over looking something?
Last Behaviour script I tried:
def commentDev = getFieldById("comment")
def defaultValue = """/**** CODING IMPACT STATEMENT ****/
(Content goes here)
/** END CODING IMPACT STATEMENT **/
""".replaceAll(/ /, '')
if (!underlyingIssue?.description) {
commentDev.setFormValue(defaultValue)
}
Hi @ChrisR,
If you want to set template for comment field during particular transition you can set initializer script with below
def value = """/**** CODING IMPACT STATEMENT ****/
(Content goes here)
/** END CODING IMPACT STATEMENT **/
""".replaceAll(/ /, '')
if(getFieldScreen().name == "Transition screen name"){
getFieldById("comment").setFormValue(value)
}
Also you can map the respective workflow if you want. I verified the above script in my space
additionally your script may fail because of the condition you added, that will add template to comment field only if issue's description is empty
Hope this helps
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.