Problems setting up workflow validator on linked issues

Issue #158 resolved
Paul G created an issue

Hi there. im trying to setup the following, but the condition fails (i cant close the ticket and I get the warning) when the linked ticket is issuetype foo and is closed.

I may be overlooking something here, can you help please? thanks in advance.

The transition requires the following criteria to be valid Validation on linked issue: At least 0 and no more than 1000 issue links with the following characteristics: - Issue link types: any - Linked issue's issue type: any - Linked issue's status: any - Linked issue's resolution: any - Linked issue belongs to any project. - Linked issue should satisfy: %{Issue type} != "foo" & "status" != "closed" About the rest of issue links: - Linked issues not satisfying filter by field values are not allowed. Message to show when validation fails: "foo linked tickets OPEN".

Comments (11)

  1. Fidel Castro Armario repo owner

    Hi Paul,

    I think that you have 2 problems in parameter "Filtering by field values":

    1. You should use field codes for foreign issues (foreign issues = linked issues). Fields codes that refers to foreign issues are preceded by ^, otherwise field codes refer to fields in current issue.
    2. You should use virtual field for Issue status with field code ^%{00016}

    You should use the following value at parameter "Filtering by field values":

    conf-1.png

    ^%{00014} != "foo" AND ^%{00016} = "Closed"
    

    WARNING: Beware of writing the name of the status and the name of the issue types exactly as they are, i.e., respecting case and trimming undesired whitespaces. Look the exact names at JIRA Administration screens, since UI often displays the names in uppercase.

    Regards,

    Fidel

  2. Paul G reporter

    Hey Fidel, thanks for coming back with this, this makes sense! I applied your example using the ID's vs. the strings, but I am still having problems with the validation failing. Is there an easy way to get a dump of the current fields and values from an issue so that I can make sure that I am trapping for the correct state?

    You mention looking at the JIRA administration screen to check the Issue type exactly. I dont see where on the administration screen to see this?

  3. Fidel Castro Armario repo owner

    Hi Paul,

    You can check the exact names of issue types at: Administration > Issues > Issue types

    Look at the screenshot:

    issue_types.png

    On the other hand, can you please explain me as accurately as possible how do you expect the validation behave?

  4. Paul G reporter

    ok checked types and made sure it was exact. Still catching the filter not satisfied. here are some screens to show what im doing.

    Capture.PNG

    Capture1.PNG

    Capture2.PNG

  5. Fidel Castro Armario repo owner

    Your current configuration behaves this way:

    In order to execute transition "Closed", any linked issue with current issue will have to be in a status different from "Closed", and will also have to be an issue type different from MDI Ops.

    In the example you show me there is a linked issue ANS-81. I can't see which issue type is, but its status is "Closed", i.e., it doesn't satisfy the requirement about the status, making the validation fail.

    Can you please, explain me in words what you intend to do with the validation? Then I will be able to give you the exact configuration you need.

  6. Paul G reporter

    Yes I can explain, sorry. its hard to transcribe with the pics.

    So basically I want to apply a validation to the close transition on these tickets whereby they may contain 0 > linked issues. If one or more of those linked issues are issue type "MDI Ops" and are still Open, then I want the transition to be blocked and the message pop up saying that this cant be closed until those MDI tickets have been closed.

    It would be valid however for this ticket to be closed with links of any other type and in any state.\

    sorry for the confusion! and thanks for helping me with this

  7. Fidel Castro Armario repo owner

    Please, try this boolean expression:

    ^%{00014} = "MDI Ops" IMPLIES ^%{00016} = "Closed"
    

    another equivalent expression is:

    ^%{00014} != "MDI Ops" OR ^%{00016} = "Closed"
    
  8. Paul G reporter

    Great!! thanks Fidel, I used the IMPLIES test and everything worked as expected. I understand that logic. I dont quite understand your equivalent expresssion though?

    so for ^%{00014} != "MDI Ops" OR ^%{00016} = "Closed"

    the test will fail if links are "MDI Ops" type OR closed? That would mean that any MDI Ops ticket OR any other ticket type that was closed would fail?

  9. Fidel Castro Armario repo owner

    You can check at Wikipedia the article about implication. There you can read: "The truth table associated with the material conditional p→q is identical to that of ¬p∨q ..."

    Written in the notation used in the plugin: p IMPLIES q is equivalent to !p OR q, which is exactly what I wrote in the second boolean expression.

    Another way to look at it: linked issues satisfying any of these conditions will be allowed:

    1. Issue type is different from "MDI Ops", since we don't have requirements for these issue types.
    2. Status is "Closed", since any issue in closed status will be ok. In particular, we require "MDI Ops" in "Closed" status.

    Sorry for explaining it so long.

  10. Paul G reporter

    No No, I got it .. thanks for this detail Fidel.I guess I need to brush up on my boolean expressions already ;) This all makes sense now, was just knee deep in workflows.

    Thanks very much for your help. the plugin is going to allow us to do some pretty clever workflow stuff in Jira!

    cheers sir.

    -Paul

  11. Log in to comment