Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Delay to load Behaviour Settings

Ali mofa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2021

Hi

I want to check my user organization and if it was in an organization , show some value of a custom field. and if it was in another organization it can show another value to it.
i write this script in Initialiser in Behaviour Settings.


import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField

FormField cForm = getFieldByName("Organizations")
FormField OrgForm = getFieldByName("Customer")
def orgValue = cForm.getValue()
def Mito = getFieldById("customfield_1111")



if(orgValue!=null){
OrgForm.setFormValue(orgValue)
}
if (OrgForm.getValue() == "1")
{
OrgForm.setFormValue("Mito");
Mito.setHidden(false);
}
else
{
OrgForm.setFormValue("None");

}


but at first when the form loading, it show all items and after 1 second it will be hidden.
any ideas what is wrong here?

Thanks
 

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 4, 2021

This is because Behaviours have to be done last when doing the page rendering.  Jira pages can be very heavy on the javascript and it can take a while for it to all load and execute, and as the Behaviour is last, you're seeing it execute at the end.

Ali mofa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 6, 2021

thanks for your response.
Do you have a solution for this?
I want  to be displayed some values from the checkbox field if the customer was a member of a specific organization. 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 6, 2021

The only fixes for this are to simplify and hence shorten the javascript needed (that's an Atlassian task, as the coders of the software) or to get a faster browser (which is unlikely to happen unless you're using a microsoft one)

Suggest an answer

Log in or Sign up to answer