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?
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.
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.