Hello!
I am currently using 4 nFeed fields (let's say A, B, C and D) in my request type. When a customer is selecting option 1 in the A field, I would like to be able to set field B, C and D required.
Here is what I wrote in my Behaviour:
import com.onresolve.jira.groovy.user.FormField;
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.priority.Priority
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
FormField subLevel1Field = getFieldById("customfield_13009")
FormField subLevel2Field = getFieldById("customfield_13010")
FormField subLevel3Field = getFieldById("customfield_13011")
FormField productField = getFieldById("customfield_13008")
String[] productFieldValue = (String[]) productField.getFormValue()
if (productFieldValue[0].equals("THETRAWIN")) {
subLevel1Field.setRequired(true)
subLevel1Field.setLabel("Sous-catégorie 1 *")
subLevel2Field.setRequired(true)
subLevel2Field.setLabel("Sous-catégorie 2 *")
subLevel3Field.setRequired(true)
subLevel3Field.setLabel("Sous-catégorie 3 *")
}
else {
subLevel1Field.setRequired(false)
subLevel1Field.setLabel("Sous-catégorie 1")
subLevel2Field.setRequired(false)
subLevel2Field.setLabel("Sous-catégorie 2")
subLevel3Field.setRequired(false)
subLevel3Field.setLabel("Sous-catégorie 3")
}
Also FYI:
Thanks in advance for your help,
Florian
Hi Laura
What I noticed:
When the Service Desk screen is created, the Elements Connect field does not have any value - it is empty ''.
Only when I select something from the list and remove it so nothing is selected, the value
Hello @Jacek Zarzycki
I'm Nelly and I'm part of the Support team at Elements.
Here's a sample Behaviour that is working on my side:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nelly
In my case it is a drop down list field.
And I have no problem reading the values.
Here is the definition
def ServerDivision = getFieldById(getFieldChanged())
def elementsConnectField = getFieldByName("My list")
elementsConnectField.setHidden(true)
elementsConnectField.setRequired(false)
if (ServerDivision.getValue().toString().contains("Division 2") ) {
elementsConnectField.setHidden(false)
elementsConnectField.setRequired(true)
}
The user selects "Division 2" in the ServerDivision field and elementsConnectField is shown on the form.
The problem is that when the user skips the elementsConnectField and clicks "Create" despite the fact that elementsConnectField.setRequired (true) is set in the behavior and there is no selected value in the field, the formula is sent anyway.
Best Regards Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jacek
I'm sorry for my late reply and thank you for the additional information.
The problem you described is an identified bug in our backlog and it affects Connect version after 6.10.0
Do you have a staging instance where you can downgrade the app to version 6.9.8 and test if the problem still occurred?
Kind Regards,
Nelly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nelly
I have version 6.11.9 on Jira 8.22.6
Best regards Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jacek
I'm sorry for my late reply.
I did further testing on my side and I'm afraid the only solution is downgrade to any version before 6.10.0 (I tested on 6.9.8 and it works correctly).
If further help is needed, please don't hesitate to reach out to our support at: https://support.elements-apps.com
We really apologize for the inconvinience and we thank you for your understanding.
Kind Regards,
Nelly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the setLabel part is working fine, that means everything directly related to Elements Connect (formerly nFeed) fields is working properly. So, problem must be related to the setRequire instruction, because from what I can see, there is no problem in your script (source: https://valiantys.atlassian.net/wiki/spaces/NFEED512X/pages/266698758/ScriptRunner+Behaviours+compatibility). And in such a case, that would mean only Adaptavist could fix that.
What's the versions of your Apps?
Kind regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nicolas,
Thanks for your answer.
I've just updated ScriptRunner which is now 5.5.6.1 and Elements Connect to 5.13.27.
Those updates did not change anything, if you were wondering :)
Regards,
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.
HI
I have the same problem
I am using the versions below.
Elements Connect 6.11.8
Adaptavist ScriptRunner for JIRA 6.55.0
The situation is critical because we receive requests where the necessary information is missing.
Kind regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jacek Zarzycki ,
To get the best help, I would recommend raising a request with Adaptavist (like the previous poster). If the problem is not with ScriptRunner, you can raise a request with Elements at https://support.elements-apps.com
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.
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.