Recently we see a lot of messages that read similar to this:
Error
There are fields that are required or in an error state, but the administrator has hidden them or made them read only using a behaviour.
Summary:
Please contact your administrator.
How can we disable these? I need to keep these fields as read-only because I dont want the user to change them on particular transitions.
If you were to get rid of the error messages, your users would not know why they can't do what they're trying to do. That would be a very counter-productive and annoying thing to do to them.
You can get rid of them in one way - configure the system so that your people can use it properly.
Not really. If a field is required and already populated in a previous transition why is it an error if the field is required in the current transition?
The summary field is always required for instance. If it is really an error to have the Summary field as read only, why is it allowed?
I do see value in these messages for case where for instance a field is required or in error and the field is hidden.
If a field is required, read-only, and empty (but not hidden), isnt this error message redundant as the "problem" will be evident in the form when the user tries to submit it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's an error because you have set it up not to work and it is useful to tell your people why something is not going to work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An error message that tells you something is not working because you have made an erros is not "fake".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have encountered a similar issue with these error messages
In our case, we have a custom field that calculates budget percentage.
The formula is being calculated in SR Behaviours with a formula ((A+B)/C)*100 where A, B, and C are also custom fields. When we enter values into fields for the first time (either while creating an issue or editing an issue when the % field is empty), the percentage is being calculated correctly without errors.
As soon as we edit one of the fields (A, B, C) when the percentage field is already calculated, a Jira error message pops up in the upper right corner (There are fields that are required or in an error state...) and an additional warning message shows up on the edit screen stating that the value of the previous % calculation is an invalid number ("'96.67' is an invalid number"). If one deletes the value in the calculated percentage field and clicks "update" the error message is still there.
The code used in the behaviors is quite simple:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FormField
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
FormField fCommitmentBudget = getFieldById("customfield_15302")
FormField fActualBudget = getFieldById("customfield_15303")
FormField fFinalConfirmedBudget = getFieldById("customfield_15315")
def cfCommitmentBudget = fCommitmentBudget.value as float
def cfActualBudget = fActualBudget.value as float
def cfFinalConfirmedBudget = fFinalConfirmedBudget.value as float
FormField cfPerOfSpentBudget = getFieldById("customfield_15304")
def calculation = ((cfCommitmentBudget + cfActualBudget)/cfFinalConfirmedBudget)*100 as float
cfPerOfSpentBudget.setFormValue(((float)calculation).round(2))
And no restrictions like "read-only" or setHidden/setReadOnly are being used on any of these fields.
Any suggestion what else can cause this?
KR,
Marko
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is Nic hiding?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, but I didn't see an email for the new question.
The errors are happening because you've used Behaviours to do something to the screen that does not let the process work. You'll need to correct that Behaviour - in this case, it looks like the field you're re-calculating is being given an invalid value.
Personally, for calculated fields, I don't bother with Behaviours, I put it in a scripted field so I don't need to mess with the UI (and it will work when issue field changes are automated or done via REST or done outside the issue edit screen)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.