So I have never had to do this before now and I'm trying to use the Regular Expression Check Validator but have as yet been able to figure it out.
Use case: I have a custom multi-select field (Documentation) that is used to capture various types of docs that are impacted by software changes (Work Instructions, Design, Test, etc.). In addition, this filed contains a value of "Docs Verified". This last value must be included in the multi-select in the final transition to Done for the transition to be allowed. All other values can be ignored but this one value MUST be in the list to move to Done.
Is this possible using the Regular Expression Check Validator or any other OOTB solution/suggestion. I realize I could do this w/ the likes of Scriptrunner but I do not have it.
My understanding is the regex validator only works on text based fields. You could do it somewhat kludgy with Automation without having to go to a third party app. The main problem with this method is that it actually does transition for a second and then get's rerouted back and the users doesn't see that. To them it looks like it is done.
thanks Dave, I considered automation but was hoping to use regex. That said, while not ideal I think automation is the only OOTB option at this point so marking this as accepted. Note you don’t need the action to set the issue to Done as the issue will already be done. Also, I would recommend adding a comment that explains the issue was auto-transition out of Done since the documentation verified was not set. Sort of yucky but it will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, it is kinda yucky and unfortunately to the user is looks like the issue did transition. I was thinking You could also send an email to the initiator. That way they get something right away telling them that the issue they just transitioned didn't really transition ... except it sorta did. If you have any webhooks that would fire off this would probably not be the solution for you. Also, I would think those in your notification scheme will also get double emailed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I searched through hundreds of Jira tickets and couldn't find anything on this topic. And if this specific detail is documented in Jira help, that eluded me as well.
Some empirical testing left me feeling this might not currently be supported OOTB for Jira Cloud / Classic Projects. More options on proceeding below.
For my testing, I added a new multi-select field with several options, and then experimented with how regular expressions in a workflow validator worked (or didn't).
The most interesting result was perhaps this test. I had set the multi-select field to contain two values (imaginatively named "one" and "two"). I then tested a "Regular Expression Check" workflow validator with the following regexp values (in separate tests):
one.*two
two.*one
I fully expected one or the other of these to have triggered. Neither did, but the most interesting artifact of the test was the error message:
Here is the content of the multi-select field for the test resulting in the above error:
If the values were separated by pretty much anything (comma, tab, newline, space, combinations of those, etc.) then that regexp should match. Even quoting of the values should not have impacted a match here. And I tested a reversal of the ordering as well.
My concern is that the error message mentions only one of the two values as the "actual value" of the field. I believe Jira internally stores "lists of values" like this as a list of objects internally, rather than as text. Prior to applying a regexp like this, I'd image that a "rendering to text" operation would need to happen. I suspect it is not, which seems like a bug. I can envision the code (default renderer returning just first item) and it seems like a good theory.
Another possibility is that the error message isn't being clear about the "actual value".
If it was me, I'd submit a support ticket for this, and engage an Atlassian Engineer. Feel free to point them to this Atlassian Community thread for some background and to leverage the testing I've done.
Please also do report back in this thread what you find out! I picked this question to research today because I wanted to learn how to do this. I'd love to hear if/how it gets resolved, and so that the entire community here can benefit from your experience.
One last thought: hitting the Jira API might be another exploratory route, to help understand what multi-select fields actually contain. That might suggest different regular expressions to try. I didn't have the time to explore that today. Still OOTB, but too far down a rabbit-hole for me.
Good luck, and best wishes!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks @Mykenna Cepek , my testing results were similar.
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.