Forums

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

I have used the behavior script description is overwritten with the original pre-populated text

sunitamumbai June 16, 2023

The user has run into an issue with the description of the ticket is being overwritten by the description we've tested in Scriptrunner. I've tested this out and can confirm that after modifying the description with relevant data and submitting the Request, the description is overwritten with the original pre-populated text

2 answers

0 votes
Tim Perrault
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.
June 17, 2023

Hello @sunitamumbai 

 

It sounds like your code needs an if statement. If you look a the tutorial from adaptavist you can see how they do it.

 Behaviours Tutorial 

 

If you look at the example, the "if (!desc.formValue) is saying if there is nothing in the description then fire the code. If there is something there don't do anything.

sunitamumbai June 19, 2023

My real issue is not the pre-population of the description field. I am able to achieve that however when the user modifies the pre-populated description(which is the expected behavior, because the user needs to add the answers) and saves the issue, the user's changes are not saved, only the pre-populated text is saved.

For example, my code can pre-populate the following question in the description.

What is the platform?

Now the user is supposed to answer this question in the following way.

What is the platform? Microsoft

now then the user saves this issue, it doesn't save the answer it only saves the text which was pre-populated, i.e. 'What is the platform?'

Tim Perrault
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.
June 20, 2023

Where are you firing the script in the behaviour? Directly on the description field or are you using a script initialiser? Try using the initialiser if you aren't already.

0 votes
Evgenii
Community Champion
June 17, 2023

Hi, @sunitamumbai 

And what is the question? As I understood from your post - everything is working fine.

You made template for request and it fills description field on creation. 

sunitamumbai June 18, 2023

The description is overwritten with the original pre-populated text and does not get saved.

Thanks

Sunita

sunitamumbai June 19, 2023

Please see above, I have added additional details in the above question

Evgenii
Community Champion
June 20, 2023

Ok, got it.

It looks like, that you have additional automation rule, that rewrites user changes.

It can be easily checked - look at issue history, if there are entries, with information entered by user, and right after that another entry with changing it to default template, then you have to look at working listeners/workflow postfunctions/automation rules.

Suggest an answer

Log in or Sign up to answer