Hi folks - I have a user picker custom field named 'Developer.' I want to disallow the 'Close' transition if currentUser equals the value of 'Developer.' Seems like it should be pretty straightforward.
To the Close transition, I added a 'Simple Scripted Condition' and used this:
currentUser != cfValues[13407]
It's not working. (And yes, 13407 is the ID for the 'Developer' field.)
Could someone help me out?
Community moderators have prevented the ability to post new answers.
Hi Dave,
Here's how you do it:
import com.atlassian.jira.component.ComponentAccessor
def developerCf = ComponentAccessor.getCustomFieldManager().getCustomFieldObject((Long)13407)
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
boolean isValid = true
if(currentUser == issue.getCustomFieldValue(developerCf)){
isValid = false
}
return isValid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to use:
currentUser?.name != cfValues["Developer"]?.name
Or
currentUser?.name != cfValues['customfield_13407'].name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you, Neta. If Ivan's approach does not work (still testing that) I'll give your suggestion a whirl.
I appreciate the help!
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.