I'm facing an issue with JIRA Automation where I cannot extract the `fromString` and `toString` values from the changelog for the "Fix Versions" field, even though the raw changelog data shows the changes are present. I've tried several troubleshooting steps, but I'm still getting empty output when iterating over the changelog. I would appreciate any insights or suggestions to resolve this issue.
Problem
I'm trying to build an automation rule that logs or processes changes to the "Fix Versions" field (e.g., adding or removing versions). Specifically, I want to access the `fromString` and `toString` values to determine what versions were added or removed. However, when I try to iterate over the changelog using smart values, I get empty output, even though the raw changelog data is populated.
Automation Rule Configuration
Trigger
- Trigger: "Field Value Changed"
- Field to Monitor: "Fix Versions" (selected from the dropdown)
Actions
- Log Action 1: Log the raw changelog data
- Raw changelog: {{changeLog}}
- Log Action 2: Log "Fix Versions" changes
- Fix Version changeLog: {{#changeLog.fixVersions}} From: {{fromString}}, To: {{toString}} {{/changeLog.FixVersions}}
- Log Action 3: Log all changeLog fields (debugging)
- All changeLog fields: {{#changeLog}} Field: {{field}}, From: {{fromString}}, To: {{toString}} {{/changeLog}}
Observed Behavior
When I edit an issue and add or remove a "Fix Version" (e.g., add `v1` or remove `v2`), the audit log shows the following:
- Log Action 1 Output:
- Raw changelog: {Fix Version=[ChangeItemBean{fieldId='fixVersions', field='Fix Version', fieldType='null', from='null', fromString='null', to='00001', toString='v1'}, ChangeItemBean{fieldId='fixVersions', field='Fix Version', fieldType='null', from='00002', fromString='v2', to='null', toString='null'}]}
- This confirms that the changelog is populated and contains the expected data for "Fix Versions" changes.
- Log Action 2 Output:
- Fix Versions changeLog: This is empty, even though the raw changelog shows changes for `fixVersions`.
- Log Action 3 Output:
- All changelog fields: Field: , From: , To:
- This is also empty, suggesting that the `{{#changelog}}` loop is not working as expected.
Expected Behavior
Based on the raw changelog data, I expect the following output for Log Action 2:
- Fix Versions changelog: From: null, To: v1 From: v2, To: null
And for Log Action 3:
- All changelog fields: Field: Fix Version, From: null, To: v1 Field: Fix Version, From: v2, To: null
Troubleshooting
I’ve tried the following to diagnose and fix the issue:
1. Verified Trigger:
- Confirmed that the trigger is "Field Value Changed" with "Fix Versions" selected.
- Tested by manually editing an issue to add/remove "Fix Versions" and confirmed the rule is triggered (visible in the audit log).
2. Logged Raw Changelog:
- Confirmed that the `{{changelog}}` smart value shows the expected data, as shown in the log output above.
3. Checked Smart Value Syntax:
- Used `{{#changelog.fixVersions}}` to access "Fix Versions" changes, which should match the internal field ID `fixVersions` in the changelog.
- Tried alternative syntax, such as `{{#changelog.Fix Version}}`, but it also produced empty output.
4. Logged Full Issue Data:
- Added a log action to output `Full issue data: {{issue}}`, which shows the issue details but doesn’t help with changelog access.
Questions
1. Why is the `{{#changelog.fixVersions}}` smart value producing empty output, even though the raw changelog shows the data is present?
2. Is there a bug or limitation in my version of JIRA that affects changelog processing in automation rules?
3. Are there alternative ways to access the `fromString` and `toString` values from the changelog?
4. Could this be related to permissions, field configuration, or customizations in my JIRA instance?