Hello everyone,
I have the following problem not only when creating a ticket, but also when editing a ticket in the future after creating it.
Field 1 (single select field) has a minimum of four values, say A, B, C, D, E, and in case A, B or C is selected, Field 2 (Date field) must not be empty and must be filled with a date, and Field 3 (Text Field) must also not be empty. If the value D or E is selected, these two fields may be empty.
Is this possible to do?
Best regards
I would add a scripted JMWE validator with the following script:
if (issue.getRawValue("customfield_SINGLESELECT_ID")?.value in ["A", "B", "C"])
{
issue.get("customfield_DATEFIELD_ID") != null && issue.get("customfield_TEXIFIELD_ID") != null
}
On the above code replace the ID of the custom fields with your IDs.
Let me know if you managed it!
@Alex Koxaras _Relational_ Hi,
thx for your time mate.
Scripted (Groovy) Validator
my script isnt working for some reason he doesnt chk the value in the field
if (issue.getRawValue("customfield_16100")?.value in ["R", "G", "P"])
{
issue.get("customfield_13651") != null && issue.get("customfield_13203") != null
}
I have to choose a For filed Box, what should i pick there or leave it empty?
I am not sure why doesnt work. Can you help me here some more?
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jurica Petricevic I dont understand the "I have to choose a For filed Box". Try to do a validation of your script first:
And paste an image of what you are getting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Koxaras _Relational_ we needed
else true
now it works.
if (issue.getRawValue("customfield_16100")?.value in ["R","G","P"])
{
issue.get("customfield_13651") != null && issue.get("customfield_13203") != null
}
else true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Koxaras _Relational_ Thx a lot. Your on my beer list :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You got to hold on to that promise @Jurica Petricevic! 🍺🍺🍺🍺
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.