Validation based on JQL

Issue #601 resolved
Burçin Çelik created an issue

Hello there,

I need to check different JQL's numbers on create transition validation.

I write the JQL %{00018} = abc AND %{11406} = "xyz" and created > startOfDay() and i can control the number of issues the above JQL but i need to control another JQL's number in the same validation control. It can be {00058} < 25 . Can I use any ephemeral number with the another JQL?

I need the control the created issue's number with other options of single select list with the same day concurrently. JQL *%{00018} = abc AND %{11406} = "edf" and created > startOfDay() like that. Other ephemeral number < 20 etc

Thanks for your help. Have a good day

Comments (5)

  1. Fidel Castro Armario repo owner

    Hi @burcincelik,

    You should use 2 different "Validation based on JQL query" in "Create Issue" transition with the following JQL queries and boolean expressions:

    VALIDATION 1:

    JQL Query:

    project = "ABC" AND "custom field name" = "XYZ" AND created > startOfDay()
    

    Boolean expression:

    {00058} < 25
    

    where {00058} is field code for Ephemeral number 1.

    VALIDATION 2:

    JQL Query:

    project = "ABC" AND "custom field name" = "EDF" AND created > startOfDay()
    

    Boolean expression:

    {00058} < 20
    

    where {00058} is field code for Ephemeral number 1.

    Note that I don't use field codes in the JQL query, but the name of the field in double quotes, as in a normal JQL query.

    When you insert field codes in your JQL query they will be replaced in runtime with the value of the fields in current issue. They are usually used for creating dynamic JQL queries that depend on the values of fields in current issue.

    Example: I can use the following JQL query if I want to use current project (i.e., the project of current issue), instead of a fixed project like in your case (i.e., "ABC"):

    project = "%{00018}" AND "custom field name" = "XYZ" AND created > startOfDay()
    
  2. Burçin Çelik reporter

    Hello Fidel,

    But i want to associate with or condition not and. Two validator connect with the and validation. I can not pass over.

    Thank you for your help. Have a good day

  3. Fidel Castro Armario repo owner

    Then you can use "Boolean validator with math, date-time or text-string terms" with the following boolean expression:

    count(issuesFromJQL("project = \"ABC\" AND \"custom field name\" = \"ZYX\" AND created > startOfDay()")) < 25 OR
    count(issuesFromJQL("project = \"ABC\" AND \"custom field name\" = \"EDF\" AND created > startOfDay()")) < 20
    

    Like shown in the screenshot:

    Captura de pantalla 2017-05-11 a las 11.09.17.png

  4. Log in to comment