Issues with 'Validation based on JQL query'

Issue #131 resolved
Paul G created an issue

Hi there, just trying the plugin to see of we can use it in our environment. I wanted to block a create transition if criteria was met. I tried changing the query syntax around to either include or exclude the match I was looking for, but I cant seem to get it to trip either way.

Basically I have this workflow across multiple projects, but if an issue is cut within a certain project and the duedate is not set, then I want the transition to fail with a warning.

Can you please help? Many thanks

setup page ..

Update parameters of the 'Validation based on JQL query' Validator for this transition.: JQL query = project = "MGE" and duedate is EMPTY

Condition = current issue doesn't belong to output of the query

Message to show when validation fails = EDC Tickets require Due Date to be set. Please set this prior to create

Capture.PNG

Comments (5)

  1. Paul G reporter

    Excellent. thanks Fidel that worked a treat!. curious as to why the other approach wouldn't have worked or am i just being stupid?

    Thanks for your help

  2. Fidel Castro Armario repo owner

    The reason is that issue is not created until validations have been satisfied and post-functions are executed. For that reason, you never find current issue in the output of the JQL query, and so validation is always satisfied.

    You should also know that values entered in transition screen (in this case "Create" screen) are not taken into account by "Validation based in JQL", i.e., JQL query will consider that current issue still has field values prior edition in transition screen.

    That is a severe limitation of "Validation based in JQL", and there is a text to warn the user about it, but perhaps needs to be improved for visibility and understandability.

    For that reason, you should use "Boolean validator with math, date-time or text-string terms" for validating fields edited in transition screen, instead of "Validation based in JQL".

  3. Log in to comment