This is probably a silly question but I am trying to use behaviours to hide certain fields on an issue type and it seems to work during issue creation but not on transition screens.
I am trying to build a timesheet workflow and want to hide the days that are not appropriate if the week ending is not a Friday so I have behaviour code like this (actually one for each day of the week):
def dayField = getFieldByName ("Sunday")
def weekEnding = getFieldByName ("Week Ending").getValue() as Date
def weekCalendar = weekEnding.toCalendar()
def dayOfWeek = weekCalendar[weekCalendar.DAY_OF_WEEK]
def dayOfMonth = weekCalendar[weekCalendar.DAY_OF_MONTH]
if ((dayOfMonth - dayOfWeek + 2)>0 && (dayOfWeek >= weekCalendar.SUNDAY)) dayField.setHidden(false)
else dayField.setHidden(true) This hides Sunday if it does not fall in the same month as the week ending field but when I use a transition screen (needed to edit the timesheet so that I can prevent other users editing someones timesheet) all the days show up.
What am I doing wrong or can't behaviours work on transition screens? I have even tried just forcing the field to be hidden (in case my logic is wrong) but it still shows up on the transition screen.