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)
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event