---
title: "My script reads the old value of a custom field"
canonical: "https://support.appfire.com/space/PSJ/15483129/My%20script%20reads%20the%20old%20value%20of%20a%20custom%20field"
format: markdown
---
> Macro (aura-html)


## Problem

> ℹ️ When running a SIL script, the value of a Custom Field is accessed incorrectly and reads the old value instead of the current one.

## Solution

Whenever changes are made to a custom field, the issue must be reindexed before the updates are accessible. This is the same whether the custom field is updated via script or by manual input.

- Make sure that any SIL Post Functions are the absolute last in the Post Function stack. For more information, see this [documentation](https://appfire.atlassian.net/wiki/spaces/JJUPIN/pages/13240802/Customizing+workflows#Customizingworkflows-Forpostfunctions) on customizing workflows.
- Reindex the issue before accessing the custom field using admReindexIssue(). For example:

> ℹ️ Note that reindexing the issue before accessing custom field values is usually unnecessary as reindexing should run each time a SIL script is run. Using [admReindexIssue() ](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=SIL&title=admReindexIssue)is a great way to troubleshoot code, but may be a sign that something is not configured correctly. If the issue persists, please create a support ticket [here](https://appfire.atlassian.net/servicedesk/customer/portal/11).

## Additional Help

Need help implementing this script? Talk to me directly to me by clicking on the bot on bottom of our [appfire.com](http://appfire.com) page.

## Related articles



> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |