Validate for Project?

Issue #826 resolved
WordPress Gmail created an issue

We need to make Priority required for only one project.

I have successfully created a validator for the first part usingA field is/isn't initialized or has/hasn't been modified.

I cannot validate for the second part; limiting validation to a single project. I've tried using Validation based on JQL query with this JQL: * project = "%{13400}". It isn't working*.

Thanks for your guidance.

Comments (7)

  1. Fidel Castro Armario repo owner

    Hi @jirasysadmin,

    Which is the content of field %{13400}?

    Is is a project key or a project name?

  2. WordPress Gmail reporter

    It is a PID value; it may not be the correct one to use.

    I obtained it this way: JIRA Admin > Projects > Copy link location for the "Edit" link alongside the project > pid=13400

  3. Fidel Castro Armario repo owner

    You should use the project key instead.

    Assuming that field %{13400} contains the project key, you can implement your validator using Boolean validator with math, date-time or text-string terms with the following boolean expression:

    %{00018} = %{13400} IMPLIES %{00017} != null
    

    where %{00018} is field code for Project key and %{00017} is field code for Priority.

    In my solution I'm assuming that the project for which Priority is required is the one whose project key is selected in field %{13400}, but in case you want a fixed project you can use the following boolean expression:

    %{00018} = "CRM" IMPLIES %{00017} != null
    

    where CRM is the key of the project that requires Priority to be set.

  4. WordPress Gmail reporter

    Both expressions you suggested have failed: %{00018} = %{13400} IMPLIES %{00017} != null %{00018} = "SI" IMPLIES %{00017} != null

    We're using native JIRA priority field, which allows you to set a default and cannot be empty. Is there an expression for %{00017} to signify it is not the default?

  5. Fidel Castro Armario repo owner

    Hi @jirasysadmin,

    Try the following validations:

    %{00018} = %{13400} IMPLIES hasChanged(%{00017})
    

    or

    %{00018} = "SI" IMPLIES hasChanged(%{00017})
    
  6. WordPress Gmail reporter

    Hi Fidel - the code for hasChanged also did not work.
    Thanks for your help; you've given me a nice trail of breadcrumbs to continue on my own.

    I'll mark this ticket resolved.

  7. Log in to comment