Hello,
I managed to retain the updated description when I changed the issue types.
Example 1: The default description displays if I select the project and issue type in the create form. After updating the description, if we change the issue type again, the updated value stays the same in the form.
However, I've encountered an issue with the field level, where the updated description is not retained.
Example 2: The default description displays If I select the field values 'Network Expansion' OR 'DNI' OR 'Mid-Market - NetSuite' OR 'Mid-Market - Partner,' but when I change the issue type, it overwrites the description and displays the template.
How can I maintain the same description in Example 2?
Here is my code on field behavior:
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def desc = getFieldById("description")
def rdField = getFieldById(fieldChanged)
def rdValue = rdField.value?.toString()
def defaultValue = """
This is the default text for any issue except the 'Requester Dept.' NOT in (DNI, "Mid-Market - NetSuite", "Mid-Market - Partner") values
"""
def requesterdeptValue = """
This is the default text for values of the field 'Requester Dept.' in (DNI, "Mid-Market - NetSuite", "Mid-Market - Partner")
If the user selects any one of these values. it should display this text.
"""
if(rdValue == ("Network Expansion") || rdValue == ("DNI") || rdValue == ("Mid-Market - NetSuite") || rdValue == ("Mid-Market - Partner"))
{
desc.setFormValue(requesterdeptValue)
}
else if(!desc.formValue)
{
desc.setFormValue(defaultValue)
}
Hi,
I suspect this has something to do with the mapping of the behaviour. Issuetype is part of the mapping and by selecting another Issuetype, depending on the type of the fields, my best bet is that some other triggers are also firing causing your description to be overwritten.
Can you share your entire rule? Also the case that does doe what you want (example 1)
Regards,
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type of field is Requester Dept? Is this an Asset field by chance? These fields On Change trigger at other moments too, not only when you change literally change them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.