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.
>or can't behaviours work on transition screens?
pretty sure they can. are you putting your script in initialiser or in a field behaviour? because if the latter, the field you put it in might be absent
if the former and it still doesnt work, try specifying the "Guide workflow", at least thats how it works for me
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.