How can I make it so that when submitting from status A to B, there is a Validator that works as follows:
Submit status A to B can be done, if Amount field <= 500
And, submit status from A to B cannot be done if Amount field >500
What is the custom field type of the Amount field? If it's a Number field, you can add a Build-your-own Validator with code like this:
!!issue.customfield_12345 && issue.customfield_12345 <= 500
where you'll need to replace customfield_12345 with the custom field id of the Amount custom field, which you'll find on the Issue Fields help tab at the bottom of the code editor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
sorry in advance, I wanted to ask again.
what if the condition become like this?
"Submit status A to B can be done, if Amount field <= 500 and = 0"
Because when I try input 0 in the Amount field, an error message will appear..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
issue.customfield_12345 != null && issue.customfield_12345 <= 500
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 @David Fischer ,
so sorry to ask you again. :(
I have a field called Application, and its values are A, B, C
now,
How to get the result,
if field Amount <= 500, then field Application is required but cannot select value A
(B, C can be selected)
is it possible to use Build-your-own validator to achieve it?
because it looks like it can't use the Field Required Validator feature
CMIIW
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @RIZKY JTUASIKAL ,
try this:
issue.customfield_12345 == null || issue.customfield_12345 > 500 || !!issue.customfield_67890 && issue.customfield_67890.value != "A"
where customfield_67890 is the field ID of the Application field (assuming it's a single-select custom field)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer , sorry for the late response, because there are other things to do first.. :(
so, if the Application field is a multi-select custom field, does the query become like this?
!!issue.customfield_12213 && issue.customfield_12213.some(it => it.value != "- No Application")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
no, more like this:
!!issue.customfield_12213 && !issue.customfield_12213.some(it => it.value == "- No Application")
since you want to forbid the "- No Application" value.
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.