How do I validate Impact and Probability on a workflow transition

This FAQ explains how to prevent a workflow transition unless the Risk Register assessment has both impact and probability set. This is a common requirement when a team wants to ensure a risk is properly assessed before moving from one status to another.

Short answer: Yes — this is possible with ScriptRunner for Jira Cloud using a workflow validator. The validator can read the Risk Register issue entity property and block the transition if the required values are missing.

When would you use this?

Use this approach when you want to enforce assessment completeness at a specific workflow gate, for example:

  • Before moving a risk from Draft to Reviewed

  • Before moving a risk from Open to Approved

  • Before allowing a risk to enter a reporting or treatment stage

In practice, this gives you better data quality and avoids risks progressing through the workflow without a meaningful rating.

What is being validated?

Risk Register stores its assessment on the issue as an entity property. For inherent assessment values, the property key is typically pbrr-assessment and contains JSON like this:

{
  "schema-version": 1,
  "inherent": {
    "impact": { "id": 3 },
    "probab": { "id": 3 }
  }
}

To pass validation, the transition should confirm that:

  • the pbrr-assessment property exists

  • inherent.impact.id has a value

  • inherent.probab.id has a value

Note: The field name in the JSON is probab, not probability. This is expected.

ScriptRunner workflow validator example

Add a ScriptRunner workflow validator to the transition that should be blocked when assessment values are missing.

def issueKey = issue.key

def response = get("/rest/api/3/issue/${issueKey}/properties/pbrr-assessment")
    .header("Accept", "application/json")
    .asObject(Map)

if (response.status != 200 || !response.body) {
    return false
}

def value = response.body?.value
def impactId = value?.inherent?.impact?.id
def probabId = value?.inherent?.probab?.id

return impactId != null && probabId != null

This validator returns true only when both values are present. If either one is missing, the workflow transition is blocked.

Recommended error message

Configure the validator error message so the user understands exactly what must be fixed. For example:

Impact and Probability must be set in the Risk Register assessment before this issue can be transitioned.

How to configure it

  1. Open the Jira workflow used by the project.

  2. Edit the transition from the source status to the target status.

  3. Add a ScriptRunner Validator.

  4. Use a Custom script validator.

  5. Paste in the script.

  6. Set a clear validation error message.

  7. Publish the workflow draft.

Tip: Test with one issue that has assessment values set and one issue that does not. This confirms both the success path and the blocked path before rollout.

Things to keep in mind

  • This approach validates the inherent assessment values shown in the entity property example above.

  • If your process depends on a different assessment structure, inspect the live entity property first and validate the exact JSON path you need.

  • The numeric IDs stored in the property are internal model IDs, so validation should check for presence rather than assume specific numbers.

 Example variation: require only one missing-value message regardless of which field is blank

If you only want a simple pass/fail rule, keep the validator logic exactly as shown above and use one generic error message. This is usually the easiest option for end users.

 Example variation: inspect the property before writing the validator

If you are unsure what values are stored on your site, first update a sample risk in the user interface and then inspect the pbrr-assessment issue property. This helps confirm the exact structure present in your environment before enforcing it in workflow logic.

Summary

Yes — validating that impact and probability have been set before allowing a workflow transition is achievable with ScriptRunner for Jira Cloud. The standard approach is to add a workflow validator that reads the pbrr-assessment issue entity property and requires both inherent.impact.id and inherent.probab.id to be present.