Hi,
I've recently tried to implement an item work conversion in a JSM project with a ScriptRunner listener.
The listener reacts on Issue Updated. Then I have a condition to ensure that not all the updates trigger my conversion:
issue.status.name == "Awaiting dispatching"
&& issue.customfield_12689 != null
The custom field 12689 is called Conversion type, it is a single select which I use to determine which type of conversion I must be perform.
The conversion itself is quite simple, 3 actions (as the item is already in a common status between workflows):
- Change work item type
- Transition to the first status of the new workflow
- Empty Conversion type
I have many issues with the Jira expression used for the condition, especially about changelog, which does not seems to be exactly aligned with the changelog object available in the groovy script, but now I have a even more strange thing:
At the whole beginning of my script I have this lines, which seem pretty standard:
final String issueKey = issue.key.toString()
final String encodedIssueKey = URLEncoder.encode(issueKey, 'UTF-8')
def workItem = WorkItems.getByKey(issueKey)
logger.info("Conversion listener V3 started for ${issueKey}")
def conversionType = workItem.getCustomFieldValue(Configuration.CONVERSION_TYPE_FIELD_NAME)
logger.info(
"IssueType=${workItem.workType.id} " +
"Status=${workItem.statusId} " +
"ConversionType=${conversionType}"
)
with
@CompileStatic
final class Configuration {
static final String CONVERSION_TYPE_FIELD_ID = 'customfield_12689'
static final String CONVERSION_TYPE_FIELD_NAME = 'Conversion type'
static final String CONVERSION_STATUS_NAME = "Awaiting dispatching"
static final String CONVERSION_STATUS_ID = "10089"
My problem is that I sometimes receive errors from ScriptRunner showing that:
CorrelationId: Self=1-6ad70bee-5d46753e131cc04e2695fce2;Root=1-6ad70bee-0e870fea0ebb5c2b33aa8b42
Script identifier: 3b73cec6-4446-4c67-a3ef-6c1e22ee96df com.adaptavist.sr.cloud.events.WebhookExecution (avi:jira:updated:issue webhook fired for issue NWA-341230) Took: 2965ms Logs:
2026-10-20 06:36:32.481 INFO - NWA conversion listener V3 started for NWA-341230
2026-10-20 06:36:33.008 INFO - GET /rest/api/2/issue/NWA-341230?expand=transitions%2Cnames%2Cschema asString Request Duration: 521ms
2026-10-20 06:36:33.486 INFO - IssueType=10041 Status=10091 ConversionType=null
2026-10-20 06:36:33.541 ERROR - No conversion rule is configured for Conversion type option ID 'null'. Configured IDs: [21115, 21116, 21117, 21119, 21153, 21186, 21219, 22984] at line 180
2026-10-20 06:36:33.542 ERROR - Class: com.adaptavist.sr.cloud.events.WebhookExecution, Config: null
How can the field Conversion type be null? How is that possible as the field is itself tested in the Jira expression?
Am I doing something wrong here?
Any help would be welcomed.