I want to add a validator in the workflow when transitioning from "In Progress" to "Done" to ensure all values from a custom dropdown field are selected. It should fail and show an error message if none are selected or if any values is/are missing. Essentially, all 4 values must be selected from the dropdown field in order to change the status.
Example- Drop down field is - Review
Values- Option1,Option2,Option3,Option4
Can some one share the syntax or an example for implementing this?
Note: I was able to achieve this with an automation rule however I want to see if its possible using workflow validator
Welcome to the community!
First let me understand that as you mention, you were able to acheive this with jira automation...but as far as i knew using the automation we can not show the message or error to the user saying that you should select all the options, but you can restrict moving the ticket from in progress to Done.
Now, how to acheive this, as @Maciej Dudziak _Forgappify_ mentioned, you need to use third party add-on wherein you can use the script and do the validation. Or the script runner add-on using which you can write a script on Initialier and it will check on the screen and show the error.
BTW all the add-ons comes with the additional costs, so if you are not interested to spend money then its best to use the jira automation as you are already did and while transitioning the ticket from In progress to Done check whether all the option are selected or not, if not then just drop a comment on the ticket saying that all the options should be selected.
Thanks @Yogesh Mude . You're right, I wasn't clear in my comment above. Using automation, I was able to add a comment instead of a validation error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I’m from Forgappify and we developed the Ultimate Validator, which is part of the Workflow Building Blocks for Jira app. It lets you use most of the power of Jira Expressions—but without writing code. Instead, you build conditions through a simple UI Here’s how the configuration for your case would look:
It comes with Jira expression preview, which you can use to learn how such an expression can be built.
I hope it will help
Cheers
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.
Hey @sumit pandey ,
To achieve this, you'll need a third-party app capable of evaluating so-called 'Jira expressions'. If you're not using one yet, you might want to look at Jira Workflow Toolbox.
Since I'm not aware of any supported method to receive the number of available options dynamically, you have to hard-wire your validation, e.g.
issue?.customfield_01234?.length == 4
if the number of available options is 4. Make sure to replace with your specific custom field ID.
Regards,
Thorsten
P.S. I'm part of the team behind the app as mentioned above.
P.P.S. This is, AFAIK, the only way to proactively(!) prevent your issues from turning into an (for you) inconsistent state, with the 'downside' of having to use an additional app. If being reactive suits your needs, you might also create a filter with an appropriate query to return all the work items that are done without having all options selected, and configure an email subscription for issues found.
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.