Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Template Field Description using Behaviours gives sometimes a popup when changing Issuetype

R_ Dekker December 10, 2020

Hi,

As many people I want to use a template (with panels) when creating an issue in the system field Description. After a long search on internet I found several solutions:  using javascript / 3th party software / customfields / behaviours.

- Javascript didn't work

- Custom fields I tried it but custom fields does not support the @mention feature in custom fields which are set on Wiki-render as the System field description has. (Even do it is available in de wiki menu of that custom field. Also I think this would mean I have to do a migration of the current content of the system field Description into the custom fields to not have multiple places where the information is available in an issue. Old versus New. So I tried this but skipped to another solution.

- 3th party software is my last option, but I rather not use it.

So now I use behaviours as described in https://scriptrunner.adaptavist.com/4.3.3/jira/behaviours-overview.html

I have 3 behaviours linked to a Project / issuetype

one for a template for the issuetype Story

one for a template for the issuetype Bug

one for clearing the field for the other issuetypes.

The problem is that I sometimes get a popup warning field:

These fields have default values for this project and issue type combination. We have preserved the existing values in case you need them.

 

Jira popup.JPG

When creating an issue such as Story the Description field is filled correctly and when I change the issuetype to Bug the Description field is filled also correctly and when changing to another issuetype the description get cleared. That works great.

But now the problem :)

Depending on the value of the template I get the popup as shown above. In my first testcases I used for issuetype Story 

def defaultValue = """This is a story""".replaceAll(/    /, '')

and for issuetype Bug

def defaultValue = """This is a bug""".replaceAll(/    /, '')

When I changed the issuetype it works great. I get no popup, except when I changed the field Description and than changed the issuetype (behaviour as desired as you want to preserve data changed by the user when overwriting the field with a template).

But when I use a defaultValue with more than 1 line such as

def defaultValue = """aaaaaa bbbbb cccccc

dddd eeee ffff

gggg

hhhh""".replaceAll(/    /, '')

or for example when I use

def defaultValue = """{panel:title=This is a title}
Template here Template here Template here
{panel}

{panel:title=This is another title}
Template here Template here Template here
{panel}""".replaceAll(/    /, '')

(This is the desired value as we want to use panels in the template)

I always get the popup when changing the issuetype even without changing the field Description. It looks like Jira thinks I altered the field Description even if I didn't. I tried many solutions like placing the value in one long line (no enters only spaces), using {empty line} and \\ for wiki render syntax, but I cannot get it to work.

The system field Description is configured to Wiki-render.

Does anybody knows the solution for this problem? What am I doing wrong?

Thanks for your input/reply!

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Dennis Schamne May 12, 2021

Have you been able to find a clean solution to prevent the warning from popping up?

R_ Dekker May 12, 2021

No. I did not find a solution. It was so annoying that we switched to custom fields.

Also not the best solution because custom fields do not support the @mention method which is one of the most used function in de wiki-render fields in our teams.

TAGS
AUG Leaders

Atlassian Community Events