Hi,
I'm trying to modify the example script where the behavior allows to change the description based on the value in priority field.
Though I need to do that with a custom field, and so far I don't get how to do it (I'm not used to that language at all).
I tried this:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.priority.Priority
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def SousCategorieCf = customFieldManager.getCustomFieldObjectByName("Sous catégorie")
if (getFieldById(getFieldChanged()).value as SousCategorieCf == "Abyla") {
getFieldById("description")
.setDescription("Merci de préciser l'élément impacté et la nature de l'impact")
}
else {
getFieldById("description")
.setDescription("Merci de préciser la nature de l'impact")
}
On the line
if (getFieldById(getFieldChanged()).value as SousCategorieCf == "Abyla") {
I get the error : Unable to resolve class SousCategorieCf
So if I change the line into :
if (SousCategorieCf == "Abyla") {
I don't get this error anymore but I don't catch the changes either.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.