How do I make a validator to enforce linked issues to be closed only in a specific project ?

Issue #291 resolved
IT MayaHTT created an issue

Hi Fidel !

I hope you can help me on that one.

I'm trying to create a Validator (Validation on linked issue) in a transition to make sure linked issues of type "blocked by" have a status Resolved or Closed in the current project. The bug here is that I have an issue blocked by two links in two different projects, and my validation does not work except if I check "Allow unselected statuses" because one of the two issues is in another project and has a status Open.

I've been playing between "Linked issues must belong to:" value current project and projects introduced + ignore links to issues in other projects. But no lock so far. It's like if the checkbox "ignore links to issues in other projects" is not really doing the job in my case :(

Here is the summary of my validator :

Validation on linked issue: At least 0 and no more than 1000 issue links with the following characteristics: - Issue link types: is blocked by. - Linked issue's issue type: any - Linked issue's status: Closed or Resolved. - Linked issue's resolution: any - Linked issue belongs to projects with keys: TDOC About the rest of issue links: - Unselected issue link types are allowed. - Unselected statuses are not allowed. - Links to issues in any other projects are allowed. Message to show when validation fails: "The issue cannot be completed as there is at least one blocking issue.".

Thanks in advance for any help.

Regards, John

Comments (3)

  1. Fidel Castro Armario repo owner

    Hi John,

    Do the following changes to your configuration:

    • Statuses for linked issues: unselect all the statuses
    • Linked issues must belong to: any project
    • Filtering by field values: ^%{00018} = %{00018} IMPLIES ^%{00016} in ["Closed", "Resolved"]
    • Unselected statuses are: are allowed

    Note that:

    • %{00018} is field code for Project key
    • %{00016} is field code for Issue status

    You can also implement the same validation using "Boolean validator with math, date-time or text-string terms" with the following boolean expression:

    count(filterByPredicate(linkedIssues("blocked by"), ^%{00018} = %{00018} AND ^%{00016} not in ["Closed", "Resolved"])) = 0
    
  2. Log in to comment