How to validate that one of a set of Components is included with simple script validator?

Samuel Schneider July 8, 2020

Hi there,

I have a set of Components, say 
Component a
Component b 
Component c 

Component 1
Component 2

From the Components a, b, c exactly 1 has to be provided, otherwise I need an error. From Components 1, 2 they can be set, but not necessarily. 

To start with, it would already be good if a validation works to check that one of the above components are provided. 

Would be great to get help on this issue as I just do not have a clue about how the script runner stuff works and also cannot find any useful documentation.

Thanks in advance!

Samuel

3 answers

0 votes
Samuel Schneider July 9, 2020

This already helped, but is not the full solution:

issue.components*.name.contains('a') ||
issue.components*.name.contains('b') ||
issue.components*.name.contains('c')

0 votes
Alexander
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!
July 8, 2020

I'd like to know it,too !!

0 votes
Samuel Schneider July 8, 2020

Additional info, I tried the following, but no idea how I can write an "OR":

issue.components*.name.contains('a')
issue.components*.name.contains('b')
issue.components*.name.contains('c')


Now only works if all 3 are present which is not the idea..

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events