Hello
I'm trying to create a field validation using behaviour, that I would like to run whenever someone changes the reporter of an issue (during creation or elsewhere in edit mode).
Basically, we need to make sure that the Reporter always belongs to a specific group.
I have tried something like the following, but without success.
//Required Imports
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def groupManager = ComponentAccessor.getGroupManager()
// Get a pointer to the reporter field and get user
def ReporterField = getFieldById("reporter")
def ReporterValue = ReporterField.value as ApplicationUser
if(groupManager.isUserInGroup(ReporterValue, 'ReportersGroup')){
ReporterField.setError("Reporter must be in Reporters group.")
ReporterField.setFormValue(null)
}else{
// If a valid value is entered clear any errors and accept the value
ReporterField.clearError()
}
Please help!
Hi @erika_zanoni ,
please try this:
{{issue.customfield_10036.plusDays(7)}}See here for documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.