Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to customize the Description field template?

Elena February 4, 2022

Hi,

We need to place a text template in the Description field on the subtask creation screen. How can this be configured?
I set up description filling with Behaviors. But the completed template cannot be edited during creation, all changes are not saved. As a result, the subtask is created with the description specified in the script.
Script:

def srd = getFieldById("description")
def defaultValue = "* Precondition: *\n"+
"* Playback steps: *\n"+
"1. \n"+
"2. \n"+
"3.\n"+
"* Actual result: *\n"+
"*Expected Result:*"

if(getActionName() in ["Create Issue", "Create"]){
srd.setFormValue(defaultValue)
}

1 answer

0 votes
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2022

I wonder if you have some leftover attempts to set the description in the Create transition of your workflow. That's what overwriting the user input after submitting.

Because what you have there should work and allow you to edit the default before submitting and the user-submitted description should be saved correctly.

Elena February 6, 2022

No, this option is correct. But for some reason, in the created task, the description becomes the one specified in the script. Is there any way to fix this? It is necessary that the set description is not fixed, but has the ability to be added and edited on the task creation screen.

PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2022

But for some reason, in the created task, the description becomes the one specified in the script

I'm confused. Isn't that the reason why you have the script in the first place?

If the description is read-only. Check that you don't have another behaviour that's adjusting this property.

And if you are able to edit the description before you submit the form, but you see something else in the sub-task then what you typed, then you have a postfunction or a listener that's making that change somehow.

Elena February 11, 2022

If I fill in other fields, then the edited description changes to the original text.
We don't have listeners, so I don't understand why this can happen.

EditDescription1.gif

PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 11, 2022

Can you show me the full configuration screen for your behaviour? Do you have other behaviours that map to the same project/issuetype (or all projects/all issuetypes)

PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 11, 2022

Oh ... where do you have your script? Did you put it in the description server-side script?

If so, then that's would be the issue.

Default description scripts have to be put in the initializer. Otherwise, each time you edit the description, when you leave the field, the script executes and resets the field.

Elena February 14, 2022

Indeed, the script was not in the initializer. I moved it to the initializer and everything worked as it should. Thanks a lot!

Suggest an answer

Log in or Sign up to answer