I know my question is quit about everything, that is because I am a bit confused here.
I want to create a Condition that through an error message to the user rather than just not allow them to make the transition on the workflow. A Validator did not help as It did not allow checking values of custom fields. And I do not really know how the user should use it (when I add validation to change value before transition for a certain existing field I get an error message even after changing that value. So not sure how that really works).
From reading other questions/answers, it seems I need to create custom Condition/Validator. On this front, I have two questions:
1- Can I create such a thing on Cloud JIRA? Or it has to be JIRA Server instance?
2- Where do I start with that exactly? Do i need to first create a Plugin, which hosts a Module, which then contains my conditional logic? Or what?? And what is that OnDemand?
I really hope someone can put me in the right path as now I am lost
Community moderators have prevented the ability to post new answers.
I think you've almost got it, but you do need to decide whether to use a condition or a validator quite carefully
A condition hides a transition from a user for some reason. It's a simple yes/no decision on whether to display the transition, there's no way to feed anything back to the users because the system is designed to hide it completely.
A validator checks data on the issue after the user enters something. A lot of descriptions I see say "it validates what the user enters before committing it", but that is not quite accurate. A validator checks all the data that would be committed - you can have validators that don't check any of the data entered by the user. Validators can feed back to the user. If they pass, the transition moves on, if they fail, they can return an error message, which JIRA will give to the user.
So, to break down your main question:
>I want to create a Condition that through an error message to the user rather than just not allow them to make the transition on the workflow.
You'll need to rewrite the way JIRA works to do that. Conditions don't have feedback
>A Validator did not help as It did not allow checking values of custom fields.
They do allow checking of custom fields, but my guess is that you don't have any validators installed that can do that. JIRA ships with a very sparse set of validators, and most admins are very fond of adding the JIRA Suite Utilities which add loads (free, well supported, available on server and cloud - well worth a look)
>when I add validation to change value before transition for a certain existing field I get an error message even after changing that value.
I suspect your validator looked at the current field value, not the value the user just entered.
>create custom Validator.
@Nic Brough [Adaptavist] many many thanks for this detailed answer!
It is now clear what I am doing wrong and what I need to do
I will check the Suite Utilities you recommended.
Regarding my question about how Validators work, you said "...your validator looked at the current field value, not the value the user just entered." The thing is, when the user "just enters" a new value and then transition, this new value is not accepted by the Validator! How do I change a value for the validator to consider as new not current?
First of all, JSU (Jira Suite Utilities) is not Cloud-compatible. JMWE (Misc Workflow Extensions) is offering only Post-functions to Cloud, but not any Validators. For example, it has a terrific validator "Field Required(JMWE)" that adds conditional execution to the Field Requiredness as well. Even Power Scripts plugin (previously JJupin) offers Conditional Validation, but not offering for the Cloud version.
So, these two Cloud compatible plugins (JMWE and Power Scripts) make me wonder if Jira Cloud is not yet ready for accepting any plugin Validators at all!! Can someone kindly confirm it??
As a matter of fact, Jira Cloud started supporting the creation of Conditions and Validators in apps only last month. And following that, JMWE for Jira Cloud will release a first batch of Conditions and Validators early April. Unfortunately, they will still be more limited than on Jira Server. For example, you won't be able to check the fields that were input on the transition screen - only the value of issue fields, however/whenever they were set.
For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events