Hello,
I'm trying to configure a validator that will check a certain field, and only if the value is x, then the transaction can be made only by members of a certain group.
I have ScripRunner & JMWE.
Can it be done?
Thanks
you can use a JMWE Build-your-own Validator with a script like:
!issue.customfield_12345 || issue.customfield_12345.value != "QA" || user.groupIds.includes("727f8cab-34e5-4cfe-ada1-b0c8452531f2")
where customfield_12345 is the custom field ID of the "found by" field (you can find it on the "Issue Fields" help tab), assuming it's a SIngle-Select custom field, and 727f8cab-34e5-4cfe-ada1-b0c8452531f2 is the group ID (you can find it using the "Lookup group..." button in the editor toolbar)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rather than Validators you could have two Conditions: one for the only in group and the other for field value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for taking the time to reply.
Can I make them work together?
My use case is that only the QA team will be able to close bugs that were created by them.
I have a field called "found by", so if the value there is "QA", then only member of the group can close, but otherwise, anyone can close.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Conditions are "and" in nature so if you have both then both must be true. So the logic table is like this...
QA group Found-by-QA > Able to transition?
No No > No
No Yes > No
Yes No > No
Yes Yes > Yes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jack Brickey I need to logic table to look like this;
QA group Found-by-QA > Able to transition?
No No > Yes
No Yes > No
Yes No > Yes
Yes Yes > Yes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't do that OOTB. Well you could use Automation to undo the transition if not allowed but that isn't very desirable.
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.
Yes, I'm sure SR can be used here but I have not personally done this. I recommend searching the community for similar, e.g. "multiple field condition transitions with Scriptrunner" or similar.
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.