You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
When declaring a variable in a behaviour, is it possible to declare something in the intialiser and reuse it elsewhere in the same behaviour?
For instance, I do a bunch of checks on assigned fields from a list and compares to validate content matches for certain conditioning. I'd like to reuse these fields later in the behaviour without re-declaring everything... is it possible?
An example is something like this:
def cf_ateam = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Assigned Team")
def ateam = underlyingIssue.getCustomFieldValue(cf_ateam) as String
def infTeams = ["Atlassian Administration","Systems Administration","Network Administration","Database Administration"]
def isInfIssue = infTeams.contains(ateam)
I'd like to reuse this (isInfIssue) later in certain field behaviours. (within the same behaviour if that makes sense)
Thanks!
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events