Validate workflow without validator

Yanduganov Andrey August 22, 2017

I have already delegated post-functions to event listeners. And now I want to delegate workflow validation to my plugin too. How can I do this?

I know that I can create custim workflow validator but in this case Ialso need to assign this validator on the specific workflow transition. Moreover, this validator will be able from validators list but I don't need it. My validator is useless outside my plugin. I need make my validator inaccessible outside plugin.

Thanks.

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2017

No, there's no way to do this.  Once an add-on announces one of its modules as a validator, it goes on the list of available validators.

I'd add code to the top of your validator to say "if called in the wrong way, return a "pass"", and put something in the description to tell admins when to use it

Yanduganov Andrey August 24, 2017

Is there a workaround to check if some fields in issue create screen are incorrect?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 24, 2017

Sorry, work around what?  I don't understand the question.  You use a validator to check the user has put data in fields that matches your rules.

Yanduganov Andrey August 24, 2017

Can I check fields without validator? May be I can write some "magic" code to do this?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 24, 2017

Validators are for checking fields (and other data) before committing a transition.  You'd have to implement a whole new structure in the workflow engine in Jira.

Why is this such an issue?  Most administrators won't use a validator that isn't relevant to their process flow, and even if they do use it in the wrong place, all you have to do is return a "no, validation failed" error by default.

Yanduganov Andrey August 24, 2017

I just hoped there is anything besides Workflow Validator to check fields. Well. Thank you!

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 24, 2017

I don't think there's another way to implement anything.

You could do stuff on the front end - injected javascript or Behaviours from the ScriptRunner add-on, but that would run on the client side, and by easy to bypass.

Suggest an answer

Log in or Sign up to answer