How to Update Assets Readonly Custom Field by Issue Status in Jira Data Center
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The use case is we have Jira issue statuses as objects in an Assets object schema and we want an Assets read only custom field to update itself according to the issue status changes. e.g., The RO custom field should update with the "OPEN" object when the issue is in OPEN status etc.

Solution
In summary we'd need to have two things to get this to work
The Read-only Assets custom fields will need this Filter Assign Scope (IQL):
Label=${Status.name}
The Status change Post-function(s) would need to have an Issue Updated event instead of the default Generic Event
Please be mindful of your existing third-party integrations, which depends on "Issue Updated" event. Changing the workflow transitions from Generic to Updated could potentially trigger unnecessary/unexpected integrations listening to updated events.
you could avoid changing the entire workflows all transitions from generic even to issue updated event if you have any other minor updates on the issue which throws an issue updated event viz., assigning the issue, changing the priority, adding a label etc. All these actions are issue updated event by default and the Filter assign Scope gets effective.
Why do we need to add the Issue Updated event?
Assets Readonly Object/s works based on the Filter Assign Scope (IQL). Filter Assign Scope (IQL) gets triggered only on Issue Created and on Issue Updated. So even though just getting the Filter Assign Scope (IQL) correct would get the issue create action get the Read only Assets CF to populate correctly, the successive transitions of the issue will not update the field. This is because, by default, Jira workflow status transitions use Generic Event and thus the Assign scope IQL does not take effect on the subsequent Status changes. That's why we'd also need to update the workflow post function and change the status transition to throw an Issue Updated event instead.
In order to get this to work for following Status changes, we'd need to change each and every transition's postfunctions from firing a Generic Event and instead fire an Issue updated event.

Locate the Transition for in the relevant workflow in Edit Mode
Click the small pencil logo on the right side of the Generic Event postfunction
Change the Event to Issue Updated from the drop down list and hit Update
Publish the workflow
You'd need to repeat the same step for every status transition postfunction
Was this helpful?