Jamie,
I am trying to develop simple script validator code to ensure that a custom field is not empty when the Component/s field is set to specific value (Other) while using v2.1.16 of your Script Runner plugin.
The following code is not working:
(issue.components*.name.contains('Other') && (cfValues['Custom Field'].getValue() != null)
Please assist and thank you very much for your services!
Community moderators have prevented the ability to post new answers.
! issue.componentObjects*.name.contains('Other') || cfValues['Custom Field']
So... the condition will be true if the components does NOT contain Other, OR, the CF called Custom Field is not empty.
Not tested.
I am almost near.Can any help me complete above requirement.
(! issue.componentObjects*.name.contains('UMB Configuration') || (issue.components*.name.contains('UMB Configuration') && cfValues['Avg File Size'] && cfValues['Avg Daily Volume'])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Meghan,
Yes, that is all. Simple things should be kept simple.
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Ryan, Are you using custom fields or attribute fields (e.g., Component/s)? What is your current script string? I used the one above on a Create transition. It says that (the Component/s field cannot = Other) or (Component/s = Other and a Custom Field must be populated. I look forward to your reply!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It says that (the Component/s field cannot = Other) or (Component/s = Other and a Custom Field must be populated).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie, Could you tell me,how can i achieve following in Script validator. Only if -->component = "UMB Configuration" and "Customization Type" = New If the above condition is ture, following two fields are required on transition. "Avg Daily Volume" is require filed. "Avg File Size" is required field Thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be much better if you only ask once rather than three times. An answer will be forthcoming on the question you asked soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jamie,
You totally rock. MANY thanks for your prompt and personable response!
The following is what I used successfully:
// Check to ensure that if the Component/s is set to "Other" then the Custom Field field must be populated. (! issue.componentObjects*.name.contains('Other')) || (issue.components*.name.contains('Other') && cfValues['Custom Field'])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jeff Peters , is this the entirety of your script? I am trying to do something very similar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.