How do I set Probability via a Dropdown List
Risk Register for Jira Cloud normally sets risk values through the Risk Register slider control. Some teams prefer to maintain a separate Jira dropdown field and use it to update the Risk Register assessment automatically.
Short answer: Yes — this is possible with ScriptRunner for Jira Cloud using a listener. The listener can read the selected dropdown value, map it to the correct Risk Register probability ID, and update the pbrr-assessment issue entity property.
Important: This is an advanced configuration. It should only be implemented by an experienced Jira administrator or scripter who is comfortable working with ScriptRunner and Jira issue entity properties.
When would you use this?
Use this approach when you want users to select a probability value from a Jira custom field instead of using the Risk Register slider, for example:
You have an existing dropdown field called Probability Input
You want to drive Risk Register probability values from a controlled Jira field
You want a ScriptRunner listener to keep the Risk Register assessment in sync when the issue is updated
In practice, this can support teams that want a simpler data-entry experience while still storing the assessment in the Risk Register format.
What does the script do?
The example below listens for changes to a custom dropdown field called Probability Input. When that field changes, the script:
Checks whether Probability Input was updated
Maps the selected label to the matching Risk Register probability ID
Reads the existing
pbrr-assessmentissue propertyUpdates only
inherent.probab.idandinherent.probab.nameWrites the updated assessment back to the issue entity property
Before you start
Create and populate a Jira dropdown custom field with the probability labels from your risk model. The example uses:
Very Unlikely
Unlikely
Likely
Very Likely
Almost Certain
Important: You must update the label-to-ID map in the script so that it matches the IDs used by your own Risk Register model. The numeric IDs are internal model IDs and may not match the example values.
ScriptRunner listener example
Add this script to a ScriptRunner listener for the relevant project or projects. Configure the listener to run on the Issue Updated event.
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
// 1. Grab issue key and changed fields
def ik = issue.key
def changeItems = (changelog.items ?: []) as List<Map>
def change = changeItems.find { it.field == 'Probability Input' }
if (!change) {
println "▶️ Probability Input not changed — exiting"
return
}
// 2. Map dropdown label to Risk Register probability ID
// Update this map so it matches your Risk Register model.
def labelToId = [
'Very Unlikely' : 5,
'Unlikely' : 4,
'Likely' : 3,
'Very Likely' : 2,
'Almost Certain' : 1
]
def newLabel = change['toString']
def newId = labelToId[newLabel]
if (!newId) {
println "⚠️ Unmapped Probability Input value: ${newLabel}"
return
}
println "▶️ Mapped '${newLabel}' → ID ${newId}"
// 3. Fetch existing pbrr-assessment property
def propKey = 'pbrr-assessment'
def getResult = get("/rest/api/2/issue/${ik}/properties/${propKey}").asString()
if (getResult.status != 200) {
println "⚠️ pbrr-assessment property not found (HTTP ${getResult.status}) — exiting"
return
}
// 4. Parse and unwrap the inner payload
def wrapper = new JsonSlurper().parseText(getResult.body) as Map
def payload = (wrapper['value'] ?: [:]) as Map
println "▶️ Unwrapped payload: ${JsonOutput.toJson(payload)}"
// 5. Find the inherent probability block
def inherentBlock = payload['inherent'] as Map
if (!(inherentBlock instanceof Map)) {
println "⚠️ No inherent block — exiting"
return
}
def probabBlock = (inherentBlock['probab'] ?: [:]) as Map
if (!(probabBlock instanceof Map)) {
println "⚠️ No inherent.probab block — exiting"
return
}
// 6. Update only probab.id and probab.name
probabBlock['id'] = newId
probabBlock['name'] = newLabel
println "▶️ Updated inherent.probab: ${JsonOutput.toJson(probabBlock)}"
// 7. Write back only the inner payload
def putResult = put("/rest/api/2/issue/${ik}/properties/${propKey}")
.header('Content-Type', 'application/json')
.body(JsonOutput.toJson(payload))
.asString()
println "▶️ PUT /properties/${propKey} returned HTTP ${putResult.status}"
How to configure it
Create or confirm the Jira dropdown custom field, for example Probability Input.
Populate the dropdown with values that match your Risk Register probability labels.
Inspect a sample issue's
pbrr-assessmentproperty to confirm the correct probability IDs for your model.Open ScriptRunner for Jira Cloud.
Create a listener for the Issue Updated event.
Limit the listener to the relevant project or projects.
Paste in the script and update the
labelToIdmap.Save the listener and test it on a sample issue.
Things to keep in mind
The script above updates the inherent probability value only.
The JSON field name is
probab, notprobability. This is expected.The example assumes the
pbrr-assessmentproperty already exists on the issue.Do not assume the example IDs are correct for your site. Always verify the IDs in your own Risk Register model.
Test first in a non-production project or with a small set of sample issues.
Summary
Yes — a Jira dropdown field can be used to update a Risk Register probability value in Jira Cloud. The standard approach is to use a ScriptRunner listener that maps the dropdown label to the correct Risk Register probability ID and updates the pbrr-assessment issue entity property.